Heads up! To view this whole video, sign in with your Courses account or enroll in your free 7-day trial. Sign In Enroll
Start a free Courses trial
to watch this video
Learn how to build a responsive website navigation, using CSS media queries and flexbox layout.
Code Snippets
Giving .main-header
a justify-content: space-between;
declaration will also align the logo to the left side of the header while pushing the nav to the right.
With this method, there's no need to target .site-logo
and declare margin-right: auto;
.
@media (min-width: 1025px) {
.main-header {
flex-direction: row;
justify-content: space-between;
}
...
Quick Reference
- Flexbox: The Next Generation of CSS Layout Has Arrived
- A Complete Guide to Flexbox
- Using CSS flexible boxes - MDN
Related Videos
Related Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign upRelated Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign up
You need to sign up for Treehouse in order to download course files.
Sign upYou need to sign up for Treehouse in order to set up Workspace
Sign up