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 trialAlexander Soroka
3,769 PointsI'm not understanding where the class 'selected' is being declared.
Where is the class 'selected' specified? I don't see it in the index.html. I see classes on the li's of 'red selected', 'blue', and 'yellow'. What am I missing?
1 Answer
Jason Anello
Courses Plus Student 94,610 PointsHi Alexander,
I'm not sure if you're asking specifically about the html but you found the li
where the class "selected" is.
When you first start out, it's the first list item which is red that is given the "selected" class. From then on, javascript is used to keep track of which color is selected and to move that "selected" class around to the different list items.
Elements can have more than one class assigned to it. So when you see class="red selected"
That means the element has a class of "red" and a class of "selected". Multiple classes are separated by a space.
You could select either of those classes in the css or both of them together in order to target that element for styling.
Is that what you were asking about?
Alexander Soroka
3,769 PointsAlexander Soroka
3,769 PointsExactly what I was asking about. Time to go retake CSS course! Thanks Jason!