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

Travis Lima
Travis Lima
15,877 Points

Did I miss something? How did "display: block;" center the navigation menu?

Did I miss something? How did "display: block;" center the navigation menu?

I am not sure why that would automatically center the navigation. I thought I was pretty clued up with display methods but for some reason, I can't wrap my head around, what Guil did there. Any help?

Maybe, I would have tried to do it differently.

Can you post a link to the video?

2 Answers

Steven Parker
Steven Parker
229,981 Points

The default for block mode elements is that they will take up the full width of their containing element (and possibly the whole window). Depending on what other settings are in effect, allowing a previously constrained element to spread out might cause the contents to become centered.

For a more specific answer, please provide a link to the course page and an approximate time index in the video.

Travis Lima
Travis Lima
15,877 Points

Thanks, everyone.

I'll remember for next time to refer to the video and timestamp when asking a question like this.

Steven Parker as I read what you wrote about the block elements taking up the full width of their container it all came flooding back - thanks.