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
Cindy Yoo
210 PointsChallenge Task
I've been stuck on this challenge question and can't figure it out. The question goes as follows:
Add a div around the featured-cupcake element, and give it the classes container and clearfix.
Here's what I have:
<body> <div id="featured-cupcake"> <h2>Cupcake of the Week</h2> <img src="img/featured-cupcake.jpg"> <div class="container clearfix"> </div> </body>
Here's the error message I'm getting: Make sure you wrap the 'featured-cupcake' element in a new div.
Not sure what I'm doing wrong here. Any help would be greatly appreciated. Thanks!
7 Answers
Wayne Priestley
19,579 PointsHi Cindy,
You need to add the div with the container and clear fix class above the div with the id featured cupcake. you can leave the closing div below.
Then your div will wrap ( opening div above and closing div below )
<body>
<div class="container clearfix">
<div id="featured-cupcake">
<h2>Cupcake of the Week</h2>
<img src="img/featured-cupcake.jpg">
</div>
</div>
</body>
Wayne Priestley
19,579 PointsYou don't need the ampersand text in the middle just container then a space then clear fix.
Don't forget the closing div at the end of the code your adding the div to.
Cindy Yoo
210 PointsThanks Wayne! Not sure if my code placement is correct below. I'm still getting same error message.
<div id="featured-cupcake"> <h2>Cupcake of the Week</h2> <img src="img/featured-cupcake.jpg"> <div class="container clearfix"> </div>
Wayne Priestley
19,579 PointsI can't see your code anymore Cindy, can you post the whole block of code the class will wrap.
Cindy Yoo
210 PointsNot sure why my code is not showing. I copied and pasted it and it just disappeared after I hit post answer button. :(
Wayne Priestley
19,579 Pointsi could see it in your original post but that is gone now too. double check the markdown cheat sheet just to be sure.
Cindy Yoo
210 Points<body>
<div id="featured-cupcake">
<h2>Cupcake of the Week</h2>
<img src="img/featured-cupcake.jpg">
</div>
<div class="container clearfix">
</div>
</body>
Cindy Yoo
210 PointsCindy Yoo
210 PointsGot it. Thanks so much for your help! :)