Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

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,266 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