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 trialBrittney Wright
1,460 PointsThe word "class" in this question is trowing me off. I also do not understand the ask of the question either.
please explain the what the question means by class, and how to recognize this potion of code.
3 Answers
Kelly von Borstel
28,880 PointsHi, Brittney. Here's a link to a short article that explains what classes and ids are, and how they differ. https://css-tricks.com/the-difference-between-id-and-class/
Samy Basset
11,862 PointsWith classes and ID's you can provide names to your elements. e.g. you can call your p tag width the name .text. ID's are used for an element with a unique name, so you supposed to use id's once. With classes you can repeat the names.
This is very important for your styling and functionality. I hope this makes sense to you. If you want to learn more read on. But if you don't understand it, there is nothing to worry about, it will make sense later on. Here is a link with the code in action:
https://jsfiddle.net/rtqatsjc/
The ID's and classes are can be called whatever you want. I am just using them as reference. In CSS ID's are called with a hashtag like #green, classes are called with a dot like .box
In the box class I provide a width and a height so we have a box(at this point the box will be transparent because we haven't declared a background color)
And in every ID I give it a background color as following:
Box with the id tim has a background of red, Box with the id of green has a green background, and the box with the id brittney has a blue background.
so for the challenge give the div a class of "favorite_stuff" as following: <div class="favorite_stuff">
Chyno Deluxe
16,936 PointsThe answer is literally in the question. You would just need to change both div tags to the example in the question.
Kelly von Borstel
28,880 PointsKelly von Borstel
28,880 PointsIf that article doesn't make sense, let me know, and I'll try to provide more help.