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

CSS

main styles vs base styles

I just finished up CSS Basics course and am now giving my shot at creating a webpage. Im heavily using the project we created in the Basics course as a guide for this first one, I plan on doing a couple more 1 pagers until I jump into the more advanced CSS courses.

In the project, Guil set up a Base Styles section and a Main Styles section. Can anyone explain the difference between these two and which rules should create for each section? Tried to do a little bit of google searching, but couldnt find much.

1 Answer

The way I view it is that your base styles are going to basically be the default style. It's probably only going to include standard/generic HTML elements like h1, p, body, ul, and so on. You could possibly even use the same base styles on more than one project. The main styles are going to be more specific to the current project. It's going to also contain classes and IDs that may be specific to the website you are working on.

For example, your base might specify that your font is 16px Arial and the text color is dark gray. This could be something that you want to be the default for all of your projects. Unless you say otherwise this will be the default style for every page on your site. Now in your main styles you might have a class called .return-policy which you change to 12px blue Verdana. This style might apply to your store website project but you would not use it on your blog project.

awesome explanation. Thanks!