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
Asim Shah
5,378 PointsCode in header.php but css in index.css or in header.css?
If i put the header into the header.css, do i need to put the style of the header.php code into a new file header.css or should i still keep the style in index.css ! Logical for me would be to put all styles in index.css, am i right?
3 Answers
Billy Peacock
8,089 PointsDude just have 1 css file, call it layout.css or something and put your styling for everything in there.
Asim Shah
5,378 PointsNot sure if that would work out on a templates based website.
Nattapol Kamolbal
15,528 PointsYou can put all your styles in one stylesheet and link it once in the <head> tag. It's more efficient this way since the browser will request less files. In your css, you can use comment to separate section styles as you want.
For naming convention, you don't have to name it as same as their file name. You can name it whatever you like. I've seen many name stylesheet as style.css or layout.css.