Challenge Use CSS Selectors to Style Elements

Challenge Use CSS Selectors to Style Elements
0.0 0

#1

Hello there. I am having an issue with this challenge. The challenge is create a CSS style element. Add the necessary CSS to turn all h2 elements blue.

<style>
h2 {color: blue;}
</style> 


<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>

That is the code I use and I get an error that my h2 element is not blue. I don’t understand why I’m getting this error. Can anyone explain?


#2

Did you remove the inline style and write a separate <style></style> where you can target h2 and give it a color: blue?
so

   h2{
       color: blue;
      }
   </style>

#3

I cleaned up your code.
You need to use triple backticks to post code to the forum.
See this post for details.

I think you deleted the entire <h2> element. You’re only supposed to delete the inline style in that <h2>.


#4

Thanks so much for your replies! The link and explanation were helpful. I think it’s a glitch, because when I put the code in here the color shows blue. Thanks again!


#5

I’m starting the basic css and I’m having the same problems withh changing text color. it changes on the phone but the code is not accepted when i run test. did it ever work for you?


#6

Hi,

Yes, I did get it to work. I deleted the entire h2 element and adding it back got it to work.

<style>
h2 {color: blue;}
</style>
<h2>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>

That’s the code I used that passed.


#7

Did you get an answer? I’m having the same problem.


#8

I had to use Google chrome and it seems to fix a lot of issues I had


#9

I just tried Google Chrome and it didn’t work either. Thanks for letting me know it works better for you though.