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 trialBolivar Arguello
Front End Web Development Techdegree Student 9,429 Pointswhich is proper for submit button when active?
which is proper for submit button ? /both work for me/
submit:active
I added a class here
input[type=submit]:active
1 Answer
Steven Parker
231,269 PointsIn programming there are often multiple ways to solve the same issue. In this case, selecting by ID and selecting by tag an attribute are both valid ways to create a CSS rule.
If your intention is to select only one element, and that element has an ID, then that method might be preferable because it takes advantage of the uniqueness of ID's and is a bit more concise to write.