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 The Selectors Solution

Joseph Michelini
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
Joseph Michelini
Python Development Techdegree Graduate 18,692 Points

Can 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
Steven Parker
231,269 Points

A 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.