Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trial
Jack Cummins
17,417 PointsWhy won't this CSS code work?
My code is
'''<!DOCTYPE html> <html> <head> </head> <body> <nav> <ul id="nav"> <li>About</li> <li>Coding</li> <li>Contact</li> </ul> </nav>
<footer>
</footer>
</body> </html>
and #nav { color:darkgreen; list-style: none; font-weight: bold; margin-bottom: 10px; width: 100%; text-align: center; background-color: black; height:40px; }
but it won't apply the styles to the list.
Please tell me what I'm doing wrong, Jack
2 Answers
Oenas Vaes
Front End Web Development Techdegree Graduate 17,319 PointsHello Jack,
Supposedly you didn't link your stylesheet to your HTML. You need to add the following code to your HTML in between the head tag.
<head>
<title></title>
<link href="style.css" rel="stylesheet">
</head>
You can read more about the link element at MDN.
Jack Cummins
17,417 PointsThanks!
tomd
16,701 Pointstomd
16,701 PointsHave you linked your CSS document to your HTML document? Like this..