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!
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
i need help with linking my html document with my CSS. i am using Sublime text 2.
Lachlan Mitchell9,278 Points
This can easily be achieved through the use of the html link element, but it can be hard to get your head around at first. To start with, open up your html document in Sublime Text. In the header section, add:
<link rel="stylesheet" type="text/css" href="PATHTOCSSHERE">.
You want to change "PATHTOCSSHERE" with the path to the css file you are trying to link the html page to.
If that css file is in the same directory (or folder) as the html page, it's as easy as typing in "style.css" with the name of the css file matching whatever you called yours. I just used style.css to simplify things :) However, if the css file is in another directory (say inside a folder called css) you would need to type out the path to it relative to the html document. In this case, you'd type "css/style.css". Generally, it's a good idea to store your css files in a css folder within the root directory (the highest folder of your page structure), as that keeps it easy to remember where you put them all later :p
Here's an example of a full header from one of my pages.
<head> <title>My Page</title> <link rel="stylesheet" type="text/css" href="css/style.css"> </head>
Hope I was able to help! If you still have questions, feel free to comment back :)
Thank you very much that really helped me a lot.