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
Markus P
6,930 Pointsmedia queries
my media queries work if i shrink the size of the browser but if I test it in the developer tools my breaking points dont work anymore. The developer tools show me then the code-changes also in the mobile version. (responisve size) So the nav is under 480 px also inline, but in the browser it looks fine.
<nav>
<ul>
<li class="wash "><a href="wash.html">Wash</a></li>
<li class="cafe "><a href="cafe.html">Cafe</a></li>
<li class="events"><a href="events.html">Events</a></li>
<li class="contact"><a href="contact.html">Contact</a></li>
</ul>
</nav>
css @media only screen and (min-width: 480px) {
nav li{
display:inline;
}
}
2 Answers
Cory Harkins
16,500 PointsSo in mobile, you want the nav to display vertically, and in full screen you want the nav to display horizontally?
When you do view in smaller browser window (shrinking the viewport) you notice the change, but when you view it through the dev tools there is no change?
Markus P
6,930 Pointsin viewport there is the vertical navigation in mobile size and at fullscreen it changes to horizontally, but in dev tool responsive version it stays horizontally - it chooses the values of the media query but ignores the code of the mobile first approach.
nav{ text-align: center; margin-top:40px;
}
nav li{ background:rgb(98, 193, 175); list-style: none; margin-top:2px; transition: 0.3s background; } nav a{ text-decoration: none; padding-top:8px; padding-bottom: 8px; color:#fff; font-family: 'Open Sans', sans-serif; font-size:1.5rem; }
nav li:hover{ background: rgb(233, 69, 62); }
css @media only screen and (min-width: 480px) { nav li{ display:inline; } }