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 trialbenaiahvarner
1,886 PointsMy CSS is not working.
Here is both my css and html. I am trying to apply this css to the html but it will not work. Please check html and css and try to find a bug. I also think there might be a problem with the html link.
h1 {
padding-bottom: 10px;
color: blue;
border-bottom: 2px dotted;
}
ul {
color: white;
background-color: blue;
}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Benaiah Varner</title>
<link rel="stylesheet" href="css/style.css" type="text/css">
</head>
<body>
<h1>CSS properties.</h1>
<p>Benaiah Varner
10/23/14<br>
The Dome and the Wise
Once, in the open plains of Montana, there live a family of grasshoppers, and a family of ants. Although grasshoppers were very playful and joyful, they did not like work. The grasshoppers played all day long refusing to gather food for the winter. Quickly, the wise ants
started working so they would have food for the winter.<br>
“The grasshoppers are going to starve if they don’t stop playing soon!” one of the ants murmured to his father.
“Winter is far off we don’t have to work yet” the dome grasshoppers demanded.<br>
But before they knew it winter brought the cold, frost bitten air and the freezing frost but the poor grasshoppers had no food at all.
“Please lend us some food for the winter, we will starve if you don’t
</p>
<h3>Lorem ipsum dolor sit amet consectetuer</h3>
<ul>
<li>CSS properties</li>
<li>CSS values</li>
<li>CSS declarations</li>
</ul>
</body>
</html>
3 Answers
Molly Morby
2,398 PointsGo double check your work and compare your work with the one on the video. I do it all the time to find my mistakes, it is worth taking the time to watch the video.
Benjamin Palladino
13,297 PointsTry this for the link see if that fixes it. Also make sure the name of the css is "style.css" and is not capital. CSS and HTML are picky things have to be exact. :)
<link rel="stylesheet" type="text/css" href="css/style.css">
Sean T. Unwin
28,690 PointsI tested your code by creating an index.html
and css/style.css
(style.css is in css directory). It all loaded fine and the css displayed as indicated.
If this is not working for you, as appears to be the case, it seems to point to a file structure issue (e.g. style.css
is not inside a folder named css
, and perhaps that folder, if it exists, is not a sub-directory of the folder where your html file is located), or there is a typo in the naming of style.css
.
I would suggest you double check the name of the file(s) and ensure you are calling the files from where they are actually located.