I just finished HTML and started CSS and I just can t pass lesson. I did it correctly but still, won’t let me pass. Did anyone have the same problem?
2nd where it asked me to style into red.
<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 CSSstyle
block. Add the necessary CSS to turn allh2
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.
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
<h2 style="color: red ;">CatPhotoApp</h2>
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.
HAHAHAHA it worked thanks man so much.Can t believe it was because dark mode.And why did that happen and how did you know?
The extension changes the style of the page and the test is looking at the styles, so it fails.
I know because it is a (ridiculously) common problem that we really should have taken care of by now. Either by changing the test, or adding a note to the challenge.
Edit: I made a PR for this. Let see if that fixes it.