Help with CSS style

Help with CSS style
0.0 0

#1

Tell us what’s happening:

Your code so far

  .red-text{
    color: red;
  }
</style>
 <h2 class="red-text">CatPhotoApp

</h2>


<p>Kitty ipsum dolor sit amet, shed everywhere shed everywhere stretching attack your ankles chase the red dot, hairball run catnip eat the grass sniff.</p>

Your browser information:

Your Browser User Agent is: Mozilla/5.0 (Linux; Android 5.1; HTC Desire 828 dual sim Build/LMY47D) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3325.109 Mobile Safari/537.36.

Link to the challenge:


#2

The only problem I can find is the missing <style> element tag at the beginning. When I add that in, it passes.


#3

I wrote it in the code, but here it did not appear it exist and despite that it gave me error


#4

Where do you put your style tag?


#5

In h2 tag to change its color to red


#6

Did you try like this? it is worked for me

<style>
.red-text{
    color: red;
  }
</style>
 <h2 class="red-text">CatPhotoApp

</h2>


<p>Kitty ipsum dolor sit amet, shed everywhere shed everywhere stretching attack your ankles chase the red dot, hairball run catnip eat the grass sniff.</p>

#7

Yeah i want to do it like this


#8

I don’t know how you wrote your html format anyways this is the correct way. Try it!

<!DOCTYPE html>
<html>
  <head>
    <style>
.red-text{
    color: red;
  }
</style>
  </head>
  <body>
    <h2 class="red-text">CatPhotoApp

</h2>


<p>Kitty ipsum dolor sit amet, shed everywhere shed everywhere stretching attack your ankles chase the red dot, hairball run catnip eat the grass sniff.</p>
  </body>
</html>

#9

Thank you appreciate it


#10

I did this i wrote the missing tags as you said to me and it didn’t change the color of the title CatPhotoApp to red


#11

You welcome!
There is two ways to use CSS in html. The one we already used now , i.e. including css elements in style tag in the head tag of html. The other one we create a new css file and link this file with the html file. see this example:

External CSS
An external style sheet is used to define the style for many HTML pages.

With an external style sheet, you can change the look of an entire web site, by changing one file!

To use an external style sheet, add a link to it in the <head> section of the HTML page:

Example
<!DOCTYPE html>
<html>
<head>
  <link rel="stylesheet" href="styles.css">
</head>
<body>

<h1>This is a heading</h1>
<p>This is a paragraph.</p>

</body>
</html>
An external style sheet can be written in any text editor. The file must not contain any HTML code, and must be saved with a .css extension.

Here is how the "styles.css" looks:

body {
    background-color: powderblue;
}
h1 {
    color: blue;
}
p {
    color: red;
}

#12

Still it is not working?


#13

Yes still not working i don’t why


#14

did you copy all your code, then hit the “reset your code” button,
then paste your code back in & try again?


#15

Can you open and see this? Do you want like this or?


#16

Yes i want exactly this output


#17

No i didn’t try this way


#18

Which browser do you use? google chrome or mozilla firefox or?


#19

I am using chrome browser


#20

close it and open it again.
or open in firefox if you have