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 trialCatherine Cameron
2,929 PointsNav bar will not align with logo
On 660px and above, the nav bar will not align with the logo. It stacks underneath name and 'Designer'. I have no idea what I did wrong.
Here's my responsive.css
@media screen and (min-width: 660px) {
/********************************
HEADER
*********************************/
nav {
background: none;
float: right;
font-size: 1.125em;
margin-right: 5%;
text-align: right;
width: 45%
}
#logo {
margin-left: 5%;
text-align: left;
width: 45%;
}
h1 {
font-size: 2.5em;
}
h2 {
font-size: .825em;
margin-bottom: 20px
}
header {
border-bottom: 5px solid #599a68;
margin-bottom: 60px;
}
}
2 Answers
Antonio Jaramillo
15,604 PointsHi, I noticed a few things missing in your code. First, I think you're missing a semi-colon after width: 45% in your nav rule and after margin-bottom: 20px in your h2 rule. However, think CSS will be forgiving of that, so you won't see any visual changes in your browser. I also noticed that you are missing float: left; in you #logo rule. That causes your nav to shift down, increasing the overall size of your header. Does that help?
Catherine Cameron
2,929 PointsThanks Antonio! That fixed the alignment problem, but pushed the nav to the top. Put some padding and now it looks great!
Catherine Cameron
2,929 PointsCatherine Cameron
2,929 Pointshere is my main.css as well