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 trialScott Moore
4,050 Pointsquestion about the class
Hey all, this video got me a little confused. In the video he used <div class="primary-content col">.
The question revolves around the class. Why 2 class into one? He used .col for a few things then used primary-content for a few others.
Why not just use one class name to achieve the same objective. Would this fall into the DRY method talked about in other videos? Or am I missing something?
Really confused as to why he is using 2 different selectors in one grouping.
Thanks for the replies
2 Answers
Jason Anello
Courses Plus Student 94,610 PointsHi Scott,
I think part of your post is missing in the beginning.
The two columns had some styles that were shared and some other styles that were unique to each column.
So by giving both columns a class of "col" you can use that one to style what is common to both. Then use "primary-content" to style what is unique about the primary column and use "secondary-content" to style what is unique about the secondary column. With a single class name for each there would be some repetition.
Does that answer your question?
Scott Moore
4,050 PointsGot it Thanks Jason, after some thought and rewatching that's what I concluded. it just wasn't sitting right at first, thanks again!!!
Jason Anello
Courses Plus Student 94,610 PointsYou're welcome.