"Python Basics (Retired)" was retired on January 7, 2016.

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 CSS Layout Basics Getting Started with CSS Layout Why Vertical Margins Collapse

Arikaturika Tumojenko
Arikaturika Tumojenko
8,897 Points

Different selectors to style h1. Any reason for that?

I've noticed Guil styled the h1 inside the header two times, first using the h1 selector and after using the .name class. Why is that?

2 Answers

Jennifer Nordell
seal-mask
STAFF
.a{fill-rule:evenodd;}techdegree
Jennifer Nordell
Treehouse Teacher

Hi there! The difference isn't really noticeable in this particular example. But imagine for a minute that you had multiple h1 elements on your page with top margins. By specifying the class to be used, you can ensure that only the h1 elements in that class will be affected by your rule instead of all h1 elements on the page. :sparkles:

Arikaturika Tumojenko
Arikaturika Tumojenko
8,897 Points

Ok, thank you. I was wondering for this example :).

Nice answer Jennifer Nordell.