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.
Edgar Mantes9,499 Points
CSS order of styling!
This question is about the organization, or order of styling my HTML via CSS. I was wondering how the professionals order their styles. I have heard the general rule of styling from general to specific details but was wondering if I can get a clear example.
I think what they are trying to get to is style the
<footer> first before you go into
<p>, etc. But does that mean you code the "block positioning" for header, body, and footer first, then style the text for h1, p, ol/ul, li of each header, body and footer? All while trying to keep the the code D.R.Y. ?
I just want to get some clarification on this topic, and examples please... and tips/tricks if you have any! Thanks!!!!
Ryan FieldCourses Plus Student 21,241 Points
For small, simple personal projects, the best way is probably just to keep it organized by section (such as header, footer, other components, and maybe a miscellaneous section). The reality is, though, that larger projects by web developers for work will probably be done in partials using Sass (my favourite) or some other CSS preprocessor. If you haven't already learned about it, there are some fantastic courses here. It seems intimidating at first, but once you get used to it, you'll never go back. :)