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 trialJeffrey Sararas
817 PointsHow many different types of elements can you assign an ID to?
I see you can add an ID to an <a> element as well as a <div>. Can you put an ID=name on any type of element and then have your #name {} declarations apply to that?
2 Answers
Ricky Catron
13,023 PointsIf you are asking if the css is going to be used for multiple elements then you should use a class. If it only applys to one element you should use an ID.
If you are asking if any element can have an ID the answer is yes it is a global atribute.
I was a little unsure of what you were asking so I took my two best guesses and answered both haha. Hope one helps.
Jeffrey Sararas
817 PointsHaha I was a little unsure of what I was asking too. Your second answer was what I was curious about, and the first answer is also helpful - the next video is discussing classes. So, thanks for both answers!
Ricky Catron
13,023 PointsGlad to help!