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


Responsive Slider Plugin - CSS Code Challenge Help

Set the class of the first "article" element to "primary", then the next "article" with "secondary" and the last with "tertiary"

Can anyone help on the above, cant get my brain around?

5 Answers

I think what they want you to do is something like this...

<article class="primary">
<article class="secondary">
<article class="tertiary">

each article will be in angled brackets with an opening and closing tag

I'm not sure what you are trying to solve, but from the sounds of it, that is the solution. :)

<div class="primary"> First Article </div>
<div class="secondary"> Second Article 2</div>
<div class="tertiary"> Third Article 3</div>

What i've got from that is it wants you to add a class to each article, first one with "primary" second with "secondary" third with "tertiary".

Jason, your answer would work, but to be as semantic as possible, it is better to use pre-defined html elements.


is already defined in html 5 as "self-contained content that could exist independantly of the rest of the content"

a very helpful resource I like to use is: https://developer.mozilla.org/en-US/docs/HTML/HTML5/HTML5_element_list

Hey thanks to you both, you have helped me a lot. Managed to pass the challenge

Zainan Zhou
Zainan Zhou
6,889 Points

My solution apparently does not work

$(".wmuSliderWrapper article:first-of-type").addClass("primary");
$(".wmuSliderWrapper article:nth-of-type(2)").addClass("secondary");
$(".wmuSliderWrapper article:last-of-type").addClass("tertiary");