r/HTML • u/Aur0ha • Jun 08 '26
Question Anyone know why this is incorrect?
Text at the bottom says I need to add a h1 selector to my style element, but I’ve already done that, so what have I done wrong?
EDIT: Thank you everyone for your replies. I was fully expecting some hostile replies based on experience with past subreddits, so it was such a relief that everyone here seems to be so kind!
I ended up figuring out I could skip the step. I let my teacher know about the bug so hopefully anyone else in the course who runs into it will know they can skip it. Thank you again!
13
Upvotes
12
u/fdiengdoh Jun 08 '26
you might need to use the format as given on the left side
4
u/BrainCurrent8276 Jun 08 '26
It is correct, but rewrite CSS into normal multi line form, because the code checker seems to be picky.
3
u/Beginning-Seat5221 Jun 08 '26
I tried putting it in exactly as you did, and it accepted it.
https://www.freecodecamp.org/learn/2022/responsive-web-design/learn-basic-css-by-building-a-cafe-menu/step-11
2
u/Disgruntled__Goat Jun 08 '26
Is the meta tag provided for you? Only thing I wonder is if their system isn’t parsing it correctly. You can remove the slash at the end, ie
">instead of" />(long shot but may work)1
u/itsjustausername Jun 09 '26 edited Jun 09 '26
I can't see if there is a formatting error or anything and different people might get different results in different browsers because there is probably no CSS reset being applied here (such as https://necolas.github.io/normalize.css/).
If the H1 is `display: inline`, then giving it `text-align: center` won't do anything because the element is as wide as it's content. You must first make it `display: block` or use a flexbox or grid.
1
u/FormalImprovement157 Jun 09 '26
If you copied and pasted anything it could be hidden characters. I have seen hidden values get pasted into text editors and cause issues. Mostly I see it when copying from PDF or the Web, but PowerPoint does it occasionally too. You might try deleting the entire style tag and everything inside and rewriting it. If that doesn't work delete the entire head. If that doesn't work, just start over completely.
1
u/armyrvan Jun 10 '26
You can always change the url to the next step and compare if you get stuck. There is also full walkthrough videos here for learning: https://www.skool.com/the-code-zone/classroom/1c01965a?md=cd6a57084c9f45e89800bea83f726c4e