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 CSS Layout Techniques Grid Layout Testing our Grid

Dylan Cairns
Dylan Cairns
11,191 Points

grid divs collapse into header

I want to make it so that the logo is above the links and the links then sit in a grid container and take up the full width (12). But when I edit the header and remove the banner the content divs are stuck way up inside the header to where you can't see the heading and half the text. http://puu.sh/gGqK5/0f8c78d603.jpg this is a picture of what happens with this code. As you can see the h2s are hidden under the header:

<body> <header class="main-header"> <h1 class="main-logo"><a href="#">Logo</a></h1> <div class="grid-container">
<ul class="grid-12 main-nav"> <li><a href="#">Link 1</a></li> <li><a href="#">Link 2</a></li> <li><a href="#">Link 3</a></li> <li><a href="#">Link 4</a></li> </ul> </div> </header>

<div class="grid-container">
    <div class="grid-8">
        <h2>Primary Content</h2>
        <img class="feat-img" src="http://lorempixel.com/400/300" />
        <p>Bacon ipsum dolor sit amet chicken pork ground round brisket corned beef ball tip shank tail salami filet mignon ham hock pork belly venison shankle. Pig kielbasa drumstick sausage pork chop boudin. Chicken t-bone salami pork chop, beef ribs kevin ham tri-tip beef venison biltong brisket.</p>
        <p>Venison strip steak meatball chicken, brisket prosciutto sirloin. Capicola drumstick brisket tri-tip salami. Chicken beef jerky, tail turkey prosciutto cow ham sirloin boudin tenderloin.</p>
    </div>
    <div class="grid-4">
        <h3>Secondary Content</h3>
        <p>Strip steak tenderloin kevin swine meatloaf capicola, doner beef turducken pancetta corned beef pork loin shoulder.</p>
        <hr>
        <p>Pork filet mignon leberkas, tail swine venison pancetta turkey shoulder brisket chalkers likes hamburgers.</p>
        <hr>
        <p>Meatball pastrami shoulder, brisket ribeye spare ribs turkey tongue strip steak t-bone.</p>
    </div>
</div>

Is it not possible to nest grid-containers inside of other grid containers?

1 Answer

Ryan Field
PLUS
Ryan Field
Courses Plus Student 21,242 Points

There's definitely something funky going on with your CSS. Can you post that so we can take a closer look?

I have a sneaking suspicion you have something in your .grid-container declarations that is causing this.