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 trialArikaturika Tumojenko
8,897 PointsDifferent 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
Treehouse TeacherHi 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.
osman musse
90 PointsNice answer Jennifer Nordell.
Arikaturika Tumojenko
8,897 PointsArikaturika Tumojenko
8,897 PointsOk, thank you. I was wondering for this example :).