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 trialJoseph Michelini
Python Development Techdegree Graduate 18,692 PointsCan I use input:active without selecting an attribute? If not, why not?
Does selecting a type attribute just make my rule more specific? If so, shouldn't I make the rule even more specific by adding a class? Is adding a class not necessary because there is only one submit button on the page?
Thank you in advance! I realize there are a lot of questions here.
1 Answer
Steven Parker
231,275 PointsA class rule has higher specificity than a type (tag/attribute) rule. But a better way to select a unique element might be using an ID, and an ID rule has even higher specificity than a class rule.
For more details, see the MDN page on CSS Specificity.