Help with CSS style

Try to set zoom to 100% :grinning:

image

@amare16
All those html, head, and body tags are not appropriate because this is a specific coding challenge on the FCC site. And using a style.css is not possible in this example. It has to be done the expected way to pass.

@Saddam

Again, when I add the <style> tag at the beginning, it passes fine for me.

Which test is it failing?

Show us the exact code you are testing with nothing left out.

As someone said, hit the “reset code” and try again. If that doesn’t work, try clearing out the browser cache. Maybe try a different browser (if for no other reason, because the cache will be clear.)

1 Like

It fails at the style tag it supposed to change the color of the text “CatPhotoApp” to red
and this is the code:

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

Again, that works perfectly for me. I have to assume that there is some other issue.

Again, I ask can you please cut and paste the entire code that you are entering. One little character off here are there can cause a problem.

And also, try clearing your browser cache. Or try it in a different browser.

There are two steps on this challenge:

  1. Inside your style element, change the h2 selector to .red-text and update the color’s value from blue to red.

  2. Give your h2 element the class attribute with a value of ‘red-text’.

It looks like you’re doing the first one. In your original post it looks like you did the second one right. As long as you haven’t changed anything else significant, it should pass. Again, the only problem with your first one was a missing style tag.

Hit the “Reset your code” button and start fresh.

1 Like

Sorry, I didn’t see that you had the complete code in your latest post. (Code needs three backticks - the key below ESC) on the line before and after or it won’t render properly. I’ve edited your post to be readable.)

When I cut and paste that code, it passes. I assume you know how to cut and paste, so there must be a problem with your browser.

Hit the “Reset your code” button and start fresh. Redo it from a clean start. If that doesn’t work, try clearing your browser cache. Or try it in a different browser.

1 Like

The code you have written is completely fine and should work. Try Again with different browser.

Thanks guys to the help my code finally passed i tried it on computer it appeared the problem on the browser i am using.