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

CSS CSS Layout Techniques Display Modes Column Layout with Inline-Block

subash maharjan
subash maharjan
2,506 Points

Whats the meaning of two words inside class?

What does class="primary_content col" mean. I am sorry but i haven't seen two words inside class. How does selecting class work in this context?

1 Answer

28,558 Points

When there are two (or more) words inside a class attribute it simply means that all of those classes apply to the element.

In other words in the example you post the element would have the class "primary_content" and the class "col" applied to it.

So everything that targeted the "primary_content" class or "col" class would end up affecting the element in question.

This is one of the things that differentiate classes from ids, an element can only have one id, but it can have as many classes as you want assigned to it.