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
Joseph Lowe
Courses Plus Student 2,170 Pointscan't get my .css document file to link to .html document file?
I'm using sublime text/editor (free version). I don't know I saved my new editor version file as a .css file it shows the file type as such but, doesn't seem to link with my .html document? I still think the .css file should be able to link to it...
<link rel="stylesheet" href="css/style.css"> I'm using the right attribute I believe from what I learned.
Joseph Lowe
Courses Plus Student 2,170 Points!doctype html> <html lang"en-UK"> <head> <meta charset="utf-8"> <title>New Page©</title> <link rel="stylesheet" href"css/style.css"> </head> <div id="wrapper"></div> <body> <header> <h1>America's best Craft Beer!</h1> </header> <nav> <fieldset> <ul> <li>first child.</li> <li>second child.</li> <li>third child.</li> <li>last child.</li> </ul> </fieldset> </nav> <table style="width:300px"> <fieldset> <tr> <th>Sam Adams©</th> <th>New Belgium©</th> </tr> <tr> <td>Boston Lager</td> <td>Fat tire Amber ale</td> <td>Oktoberfest</td> </tr> <tr> <td>Eve</td> <td>Jackson</td> <td>94</td> </tr> </fieldset> </table> <form class"e-form"> <input type="email"name="email"> <input type="submit"name="submit"> </form> <section></section> <footer></footer> </body> </html>
8 Answers
Stone Preston
42,016 Points<link rel="stylesheet" href="css/style.css">
according to your link you have a file named style.css thats located in a folder called css. Is that correct?
Joseph Lowe
Courses Plus Student 2,170 PointsI've already used that same code with attribute. I even erased my code & copied yours but, still doesn't link???
Zack Taylor
9,021 PointsLook at the "folder structure" my friend. Could it be something like .... link rel="stylesheet" href="../css/styles.css" add <> as its not letting me add code in this text area.
Joseph Lowe
Courses Plus Student 2,170 Pointsthe folder says its a css type which sounds correct wouldn't you say? or should it be something else?
Joseph Lowe
Courses Plus Student 2,170 Pointsno I've got that code already nested that's why I'm puzzled...I mean unless somebody knows something that wouldn't allow it to reference my saved html file??? with <link rel"stylesheet" href"css/style.css">
Zack Taylor
9,021 PointsMake sure your checking to see everything is in lowercase. Also make sure the spelling is correct. I sometimes put styles/style and in my html document its different. Check the HTML link="stylesheet" href="css/style.css" <---- (file name is correct)
Zack Taylor
9,021 PointsAlso one more note... Have you got the link rel="stylesheet" href="styles.css" in the correct place in the document ? It should be in the header tags and also it does depend what order you put other files in to take effect. send us a link thru codepen and i will take a look for ya. :) (TRY MY BEST)
Jeff Busch
19,287 PointsHey Stone Preston ,
You stated to Joesph according to your link you have a file named style.css thats located in a folder called css. Is that correct?. What link are you referring to? I don't see any link in his post.
Jeff
Jeff Busch
19,287 PointsHey Joseph,
If you look to the bottom right of the text box you will see something that says Markdown Cheetsheet. If you don't understand that maybe this will make sense: How to display code at Treehouse
Joseph Lowe
Courses Plus Student 2,170 Pointsfile:///Users/LoweJunglegrove/Documents/Screen%20Shot%202014-04-22%20at%205.46.23%20PM.png
Jeff Busch
19,287 PointsOk, I see your code above. Make sure the file is named style.css and the directory structure is like this: Typical Directory Structure. Don't be concerned with the inc, img, and javascript directories.
Scott Averay
1,850 PointsI always find using the 'Type' (e.g. type="text/css") attribute solves this. Example: <link rel="stylesheet" type="text/css" href="css/style.css">
Joseph Lowe
Courses Plus Student 2,170 Pointshey, guys its working now lol whatever not sure why it wasn't working maybe it was my internet connection or some such lunacy thx dudes!!!!
Jeff Busch
19,287 PointsJeff Busch
19,287 PointsHi Joseph,
Could you show the code in the html file?
Jeff