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 How to Make a Website Responsive Web Design and Testing Adjust the Profile Page and Header

My Navigation is Floating All the way up to the right. It doesn't align with my H1, H2's @660px. Please Help.

This is what I have in. Thanks in advance everyone!

@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 { float: left; margin-left: 5%; text-align: left; width: 45%; }

h1 { font-size: 1.5em; }

h2 { font-size: 0.825em; margin-bottom: 20px; }

header { border-bottom: 5px solid #599a68; margin-bottom: 60px; } }

Remove that float: right from your nav.

3 Answers

Brian Pohuski
Brian Pohuski
5,386 Points
nav {
    background: none;
    float: right; /* <-- Either remove this or float:left; */
    font-size: 1.125em;
    margin-right: 5%;
    text-align: right;
    width: 45%;
}

Hi guys,

So i did two things.

  1. I deleted the float: right; and also tried using "left". It didn't work.

  2. I deleted the float and it completely dropped the navigation to the center of the page while viewing on the desktop.

any other thoughts?

thanks again.

Brian Pohuski
Brian Pohuski
5,386 Points

Hi Nick! Could you please put your full code into a snippet on a sandbox environment such as codepen or jsfiddle and then post the link? I am not sure we will be able to efficiently help you further without knowing all the other things that might be affecting your layout.

Thanks!

I figured it out! I went back to my Main CSS and I saw that I put an incorrect semicolon after margin : / Thanks so much for the help! BTW. I sorta got confused when going about using codepen or jsfiddle.