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

Stuck On the First Step

Add a 'div' around the 'featured-cupcake' element and give it the classes 'container' and 'clearfix'.

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

4 Answers

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

What's wrong on this code?

James Barnett
James Barnett
39,199 Points

@Raymond - We can't see your code.

In order for the forum to correctly format your code make sure to indent each line of code with 4 spaces.

Amit Bijlani
STAFF
Amit Bijlani
Treehouse Guest Teacher

Your closing div for the container should be placed right before the body tag. So your code should like this:

<body>
  <div class="container clearfix">  
      <div id="featured-cupcake">
        <h2>Cupcake of the Week</h2>
        <img src="img/featured-cupcake.jpg">
      </div>
  </div>
</body>
</html>
James Barnett
James Barnett
39,199 Points

@Raymond - To expand upon what @Amit said ...

You need to nest the div with the id feature-cupcake inside of the div with the classes container clearfix.