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 trialFedor Andreev
6,438 PointsMy link does not seem to work? Could someone tell me what I did wrong? (Codes included)
The HTML file
I'm taking about <link> e.t.c
<head> <title>Adding CSS</title> <link rel="stylesheet" href="css/style.css"> <style type="text/css"> h1 { color: white; background-color:#E14607 } </style> </head> <body style="background-color: #01c7c8;"> <h1>Adding CSS to the Page!</h1> <p style="font-weight: bold;">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum non diam justo. Integer accumsan lacus ut quam pulvinar ullamcorper. Proin imperdiet mauris ac lectus blandit adipiscing. Vestibulum placerat mi sit amet odio luctus quis aliquam ante tristique. Praesent sem ligula, rhoncus quis gravida vitae, consequat id odio.</p> <p>Etiam eros nisl, pretium nec suscipit ac, gravida quis velit. Phasellus adipiscing ultrices lorem, ut porttitor tellus interdum eu. Fusce auctor, felis vitae adipiscing vulputate, tellus odio venenatis lorem, et pretium lectus justo vitae ipsum. Mauris in dictum dolor. Sed fermentum, dolor nec mollis lobortis, eros augue laoreet tortor, vel cursus neque sem ac diam.</p> <h2>Lorem ipsum dolor sit amet</h2> <ul> <li>Praesent sem ligula rhoncus</li> <li>Donec ut ipsum at quam</li> <li>Maecenas libero neque accumsan ut</li> <li>Donec quis mauris ipsum</li> </ul>
</body>
The style css file with color codes
h2 { color: steelblue; padding-bottom: 10px; border-bottom: 2px dotted; }
ul { color: white; background-color: steelblue;
}
My folder is called css
structure.html style.css
THANKS!
Fedor Andreev
6,438 Pointscolor codes:
h2 { color: steelblue; padding-bottom: 10px; border-bottom: 2px dotted; }
ul {
color: white;
background-color: steelblue;
}
4 Answers
Joakim Bergman
14,501 PointsThere is a missing semicolon after #E14607, I don't know if could be that.
Fedor Andreev
6,438 PointsNo it's okay I just fixed it but I don't now why it works now?
I have a folder named
css (on my desktop)
2 files inside
structure.html style.css
I fixed the problem by changing the href="style/style.css" to href="style.css"
Aren't you supposed to give it a directory? I'm so confused.
Joakim Bergman
14,501 Pointsif your .html file is in the same directory you shouldn't give it the the directory.
Joakim Bergman
14,501 PointsFor example if your html file and css is in the same directory the path is style.css. If you make a directory inside this directory called css and put the style .css file in it but the html file is still in the first directory then the path is css/style.css.
Fedor Andreev
6,438 PointsFedor Andreev
6,438 PointsFor some reason it completely destroyed my whole post.
I'll shorten it
My link
<head> <title>Adding CSS</title> <link rel="stylesheet" href="css/style.css"> <style type="text/css"> h1 { color: white; background-color:#E14607 } </style>