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

HTML How to Make a Website CSS: Cascading Style Sheets Take a Mobile-First Approach

Why do we have one rule for logo and another for h1 and h2? Aren’t they basically the same?

Why do we have one rule for logo and another for h1 and h2? Aren’t they basically the same?

1 Answer

Joel Bardsley
Joel Bardsley
31,246 Points

Hi Anthony,

By doing it the way Nick's done it keeps the code cleaner and reduces the risk of possible issues as the project grows. There's the possibility of additional H2 tags being used as standard headings later in the project, which might not need to be center-aligned.

Also, by keeping his logo self-contained with an id of logo, it makes it easy for Nick (or any other developer that works on the project) to locate the necessary styles in the css and allows the developer to change them safely without affecting anything else on the site.

Hope that helps,

Joel