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
Camilo Alfonso
2,688 PointsDifferences between selectors.
What would be the difference between these?
Form[Class="Form-contact"]{ color: red; }
and
Form .Form-contact{ color: red; }
2 Answers
David Bilson
13,819 PointsThe first one is an attribute selector, whereas the second is a class selector.
In this simple example they both do the same thing, as Alexander mentioned.
However you can be more selective with an attribute selector. Below is a lowdown on the different ways you can select items with an attibute selector:
Alexander Davison
65,469 PointsActually, I believe they are precisely the same thing! I usually use the second one, because it is a little more readable to me.
Good luck programming! :)
Hope this helps, ~Alex