My CSS is not working

Hi there, :wink:

My first post ever. I have made this website but my CSS does not work. I cannot understand why.

HTML seems to be corect.

Please advise. I want the website to show neatly lined up not like scattered around. Here is a link:

Thanks

Adam

So your HTML is where your problem lies. The html tag should have two child nodes: headand body. Yours has a script, a meta, a head, and a bunch of stuff that belongs in a body tag, but no body. CSS rules use the body as the document root - without that, no style rule will apply.

1 Like

Thanks I will add body. Thank you

Just FYI on Codepen you only need the main content, not the HTML or body. Anything you want to add to the head you can do in the Codepen settings.

Your nesting is quite broken, looks like 85% of all your SCSS is nested inside the nav selector. You also have duplicate selectors which suggest some copy-pasting gone wrong. I tried to make it into plain CSS but that didn’t help much, still was fairly broken. Then i looked at the HTML and you have missing closing tags, incorrectly closed tags (<tagname/> instead of </tagname>), you have broken inline styles (style=width=30px; height=30px;). Even after trying to fix all the HTML, the page still looks broken.

I tried to unbreak it but gave up, this is as far as I got.

Oh, and you probably shouldn’t put Copyright you name on a page with Apple products.

1 Like

Thank you for your time to help me out. I will try to fix it now. Thanks Lasjorg. Adam