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 trialFedor Andreev
6,438 PointsI thought you could only have one ID on a page?
id="s1" id="s2" id="s3"
Why are there more than 3?
This is the lesson
http://teamtreehouse.com/library/css-foundations/advanced-selectors/additional-pseudoclasses
2 Answers
Leonardo Hernandez
13,798 PointsEach html element can have an id, but that id has to be unique and for that element only. It cannot be used twice.
<!-- This is OK -->
<div id="s1"></div>
<div id="s2"></div>
<div id="s3"></div>
<!-- Not OK and I believe styles of this id wont be applied to all of these elements -->
<div id="s1"></div>
<div id="s1"></div>
<div id="s1"></div>
Andy Tan
35,969 PointsYou can't have multiple ID's on a page, but you can't reference the same ID more than once on a page. So in that lesson one of the <li> elements has an an id "s1", which means no other element on that page can have the ID "s1", but you can have other elements with other ID's which can be referenced
Hope that helps :)
Leonardo Hernandez
13,798 PointsLeonardo Hernandez
13,798 PointsHey Fedor, You have to select the best answer so I can have some points :) I see you've started a new thread as well. Make sure you select the best answer for that question as well.