So I just started the CSS tutorial and I have to make the h2 text red. Easy stuff, I do exactly what it says to do, even check the video guide to make sure it’s correct and it is… except it won’t accept my answer. The text changes to red, but the program says that it doesn’t. (I added spaces below to show what my code reads)
< style >
.red-text {
color: red;
}
< / style >
< h2 class=“red-text”>CatPhotoApp
Nothing seems to be wrong with the code if it works as intended, but the program keeps marking it as wrong, giving the error message of, “Your h2 element should be red.” Any ideas how to fix this?
First of all, when you post a question about a challenge, use the “Ask for help” button - it will give a link so we don’t have to go looking for the challenge.
I tried the challenge and for some reason it didn’t work the first time but did the second. I don’t know.
But looking at your code, I notice some extra spaces in your script
tags, opening and closing. HTML doesn’t like that.
My apologies for not clicking “Ask for help,” I’m new here, but now I know where to go.
Although you ran into the same problem I did, thank you for taking the time to respond. I’ll just mess with it a bit and see if I can get something to click.
Cool, we all gotta start somewhere. You’ll find this is a really friendly and supportive bunch of guys and gals. Another nice thing is the button will post your exact code. Since you’re already here, if you’re still having problems, please post your complete code. If you put three backticks (the key below ESC) alone on a line before the code and do the same on the line after, it will format nicely.
1 Like
The exercise wants the Style change the other way within the
tag like this:
<h2 style="color: red;>CatPhotoApp
Thanks for the response. I guess I should’ve edited/deleted the post once I figured it out. It’s way dumber than that: one of my browser extensions was glitching out and was interfering with the freecodecamp software and prevented it from properly reading the code. I had to disable it to get it to work.
No need to delete.
And yeah, browsers can be touchy with FCC. Sometimes you need to clear the cache or try it on another browser. Glad you got it worked out.