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

General Discussion

How do you separate your html and css documents from each other per webpage?

As I create my website and add more and more pages to it I can see myself losing track of which html and css documents go with which page. How do you organize them? Naming them? Folders? Ect? Also, if it's something such as folders how do you fix this in your html after you've moved/renamed them? Thanks.

2 Answers

Jeff Lemay
Jeff Lemay
14,268 Points

If I'm just using html and css (no php), I would:

  • Keep all my html files in the root folder. Index.html for the homepage, about.html, contact.html, products.html, etc.

  • Put my css files in a css folder. I'd have a normalize.css file and then a styles.css file which contains all my custom css for the my site. All pages share the same css file.

  • Put all my images in an img or image folder.

If you move files into folders after using a different structure before, you'll just have to do a find/replace for links. There's no super simple way to do that with just html.

EDIT: I have no idea how to make an unordered list using the markdown cheatsheet.

EDIT AGAIN: Apparently it's dashes instead of plus signs.

i guess you could. create another css file and link that file to the page