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 trialVictor Gordian
4,656 PointsCan you id and class anything?
So whatever is nested inside the header or body, i can id or class it? or are there some sort of rule that only lets select some things inside the body or header
2 Answers
Sebastian Mercado
8,800 PointsYes, you can apply a class or id to any element within the body. You can also apply a class or id to the header since the header is inside the body element. A specific id can only be used once, where as a class can be used through out the website. Classes should be used more often than id's. Hope this helps.
Andrew Hansen
Courses Plus Student 6,454 PointsAlso worth noting:
ids have a lower specificity than classes. So if you have a class and an id on an element, the id CSS will override any class CSS
Nicolás Carrasco-Stevenson
Courses Plus Student 5,668 PointsYou mean id selector have HIGHER specificity than class selectors. More specific rules will always override less specific rules