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

CSS

Position of the class.

Why can't class="grid_5" in the second “div” be put into the first “div” <div class="container clearfix"> <div id="featured cupcake" class="grid_5"> <h></h> <img src=> </div> </div>

James Barnett
James Barnett
39,199 Points

We are going to need more context.

A James said. But I would assume the first div is the container.

1 Answer

Tibor Ruzinyi
Tibor Ruzinyi
17,968 Points

If you wanna put some div into another div u need to make it like this

<div>/*first div*/
   <div>/*second div*/
   </div>/*first div closing tag*/
</div>/*second div closing tag*/

i think that you are using some boiler plate. so u can try this for example :

 <div class="grid_6" style="background-color:red">
                <div class="grid_2" style="background-color:grey">asdadasdasdadadadasdasfsdfsdfsdfsdfsd</div>
</div>

u wiil see the 2 divs exactly where they are as their background colors are different for each.