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
Cecil Quist
2,851 PointsNavigation Aligning to Top of Header
So, let's say the "ssss" block is my logo, and the "xxxxx" is my navigation.
ssssss uuuu uuuu uuuu
ssssss
ssssss xxxxx xxxxx xxxxx
After applying a media query, when the browser size changes to a bigger screen, the navigation aligns to the top as indicated by the "uuuu". But on a mobile screen it aligns properly and centered.
Here is the code:
@media screen and (min-width: 660px) {
nav {
background: none;
float: right;
font-size: 1.125em;
margin-right: 5%;
text-align: right;
width: 45%;
}
#logo {
float: left;
margin-left: 5%;
text-align: left;
width: 45%;
}
h1 {
font-size: 2.5em;
}
h2 {
font-size: 0.825em;
margin-bottom: 20px;
}
}
or
http://codepen.io/cquizo/pen/cCpiE
I really don't know how to get my images into codepen. Can someone help?
Thanks.
C
4 Answers
Cecil Quist
2,851 PointsThanks guys; I figured it out.
Cee
Dave Evans
13,160 Points@media screen and (min-width: 660px) is only for screens 660px and more, do you have specific styling for your mobile sizes?
Cecil Quist
2,851 Pointsyes Dave. so my mobile sizes is up to 480px. It's the 660px that i'm having the issue with
thanks.
Cecil Quist
2,851 PointsOkay, here's how it looks. I hope you can access the site:
http://web.ie1446bhcf.treehouse-app.com/about.html
see the navigation flushing at the top right