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

HTML

Add the classes 'grid_5' and 'omega' to the 'featured-cupcake' element.

<body> <div class="container clearfix"> <div class="grid_5 omega"> <div id="featured-cupcake"> <h2>Cupcake of the Week</h2> <img src="img/featured-cupcake.jpg"> </div> </div> </div>
</body>

6 Answers

Zach Cooke
Zach Cooke
1,681 Points

You can place a class within the id line. This will allow the command to pass. For example: <div id="featured-cupcake" class="grid_5 omega">

Kevin Korte
Kevin Korte
28,148 Points

You can add two classes to an element by putting a space between them, like so:

<div class="class-1 class-2"></div>

Thanks Kevin. But my computer crashed so I didn't have a chance to complete my question.

I'm working on "Add the classes 'grid_5' and 'omega' to the 'featured-cupcake' element."

here is the code for it - when I submit it - the auto response tells me "Oops! It looks like Task 1 is no longer passing." (Task One was "Add a DIV for "container" and "clearfix")

<body> <div class="container clearfix"> <div class="grid_5 omega"> <div id="featured-cupcake"> <h2>Cupcake of the Week</h2> <img src="img/featured-cupcake.jpg"> </div> </div> </div> </body>

did you change the code from task 1 at all?

Thanks Kevin. But my computer crashed so I didn't have a chance to complete my question.

I'm working on "Add the classes 'grid_5' and 'omega' to the 'featured-cupcake' element."

here is the code for it - when I submit it - the auto response tells me "Oops! It looks like Task 1 is no longer passing." (Task One was "Add a DIV for "container" and "clearfix")

<body> <div class="container clearfix"> <div class ="grid_5 omega"> <div id="featured-cupcake"> <h2>Cupcake of the Week</h2> <img src="img/featured-cupcake.jpg"> </div> </div> </div> </body>

Kevin Korte
Kevin Korte
28,148 Points

Sorry to hear about your computer. : /

It sounds like they want you to wrap the featured cupcake element inside of another div with the two classes "container", and "clearfix". Is the featured-cupcake element a picture? I do not remember this challenge too well.

I'l focus on getting the first challenge to pass first. Let me know

Thanks for your help everyone. Zach's comment was most helpful. Instead of three stand alone items for each: <div class="container clearfix"></div> <div class="grid_5 omega"></div> <div id="featured-cupcake"></div>.

....it seems the computer wanted this: <div class="container clearfix"></div> <div id="featured-cupcake" class="grid_5 omega"></div>.

I too am having trouble passing this challenge. Can someone explain it to me?

James Barnett
James Barnett
39,199 Points

Here's a hint, sometimes you don't need to add an extra <div>. In this case, add the 2 needed classes to the element with the specified id.