Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

CSS The Selectors Solution

Joseph Michelini
.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
217,577 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.