Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

CSS CSS Grid Layout Going Further with Grid Layout Placing Elements Using Grid Template Areas

ian truong
ian truong
4,685 Points

grid placement in css are amazing but i have one concern. can header and nav share one space?

header{
  grid-column: 1 / 3;
}

nav{
  grid-column: 1/3
}

1 Answer

Steven Parker
Steven Parker
216,045 Points

That should put them in the same columns of two different rows.

To have them share one space, either put one inside the other (it's common to have a nav section in the header), or enclose them both in a shared container.

ian truong
ian truong
4,685 Points

but how do you put one inside the other?

Steven Parker
Steven Parker
216,045 Points
<header>
    header stuff here
    <nav>
        nav stuff here
    </nav>
</header>
ian truong
ian truong
4,685 Points

omg.. yes thats so simple lol. i forgot all about nesting nav inside header with html. thank you!