Html to CSS cant pass

Html to CSS cant pass
0

2nd where it asked me to style into red.

You need to supply the challenge url and you need to post the code you have tried.

To enter a code block into a forum post, please precede it with a separate line of three backticks and follow it with a separate line of three backticks to make it easier to read.

See this post to find the backtick on your keyboard. The “preformatted text” tool in the editor (</>) will also add backticks around text.

Note: Backticks are not single quotes.

<h2 style="color: red";>CatPhotoApp</h2>

On right side I can see it changed to red. But when I click run the tests it said Your h2 element should be red.

please format correctly, or it is impossible to see your code
this time I am going to do it myself, but if you don’t learn to do it it will be difficult asking for help…

Well I thought that I have to put those back flips or whatever is name of those.

next time also please use the “Ask for Help” button, or at least link the challenge
because if it is this one: https://www.freecodecamp.org/learn/responsive-web-design/basic-css/use-css-selectors-to-style-elements

this is what you need to do:

Delete your h2 element’s style attribute, and instead create a CSS style block. Add the necessary CSS to turn all h2 elements blue.

but it doesn’t correspond to what you are saying

you didn’t put any backticks around your line of code there…

Sorry it s this one https://www.freecodecamp.org/learn/responsive-web-design/basic-css/change-the-color-of-text

look at your semicolon, look at the example code

An example from W3Schools:

<h1 style="color:blue;">This is a Blue Heading</h1>

As said above, the correct syntax is to put the semicolon inside the quotation marks, as that semicolon is a required part of the CSS syntax.

1 Like

Change your h2 element’s style so that its text color is red.

I did it correctly

CatPhotoApp

It wont let me pass over and over again for last 2 days.

I did all of that and it s just h2 and red color same code i typed and I can see Heading changed to red on right side. But when I press run tests it said that h 2 element should be red.

your issue is the semicolon, look where it is in your code and where it is in the exampe code

It s not. It s same code. And guy in video said the same thing I bassicly copied ad it won t let me pass but core is correct.

your semicolon is outside quotes

Can you please repost your latest code attempt? Make sure to use backticks ``` on the line before and after the code you paste, so that it shows up correctly on the forum.

<h2 style="color: red ;">CatPhotoApp</h2>

When I try the code you posted above, it does seem to pass. Can you try refreshing your page (Ctrl+F5 on Chrome using Windows) and use the same code again when running the tests? You may also need to click Reset All Code first.

If the code you have posted does not work, make sure you do not have an extension installed that is changing the page. Like any dark mode extension will need to be disabled. You can use the dark mode theme under the profile settings instead.

If that isn’t the issue then try using a different browser.

1 Like