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 trialTiffany Haltom
6,769 PointsLink for CSS and HTML file not working
So I created the work files in Sublime Text 2 (one under index.html and the other under style.css) and when I use the link element, the two files aren't working when I load it on Chrome, or any other browser. I've gone over the code but I can't seem to fix the problem.
Ken Alger
Treehouse TeacherRavi;
Would you mind posting your code, likely only the <head>
section of your HTML is necessary to see the stylesheet links. Also, make sure that the style.css
file is in the appropriate file location as is referenced in your <link>
tag.
Ken
2 Answers
Tiffany Haltom
6,769 Points<head>
<title>Adding CSS</title>
<link rel="stylesheet" type="text/css" href="style.css">
</head>
(saved as index.html). I can see the unstyled html in the browser, just not the css
CSS File:
h2 {
color:steelblue;
padding-bottom: 10px;
border-bottom: 2px dotted;
}
ul {
color: white;
background-color:steelblue;
}
Tiffany Haltom
6,769 Pointssaved as style.css
Ken Alger
Treehouse TeacherRavi;
If your style.css
is not in the same folder as your index.html
you need to adjust that in your <link>
line of code.
Ken
Jason Anello
Courses Plus Student 94,610 PointsJason Anello
Courses Plus Student 94,610 PointsHi Ravi,
Can you post the
<head>
section of your html file?See this guide for how to post code: https://teamtreehouse.com/forum/posting-code-to-the-forum
Are you seeing your unstyled html page in the browser?
Do you have your html and css file in the same folder?