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

HTML How to Make a Website Responsive Web Design and Testing Adjust the Profile Page and Header

Jacob Smith
Jacob Smith
10,926 Points

Sizing and alignment issues with my h1, h2, and nav tabs.

Here is a snapshot of my workspace:

https://w.trhou.se/jbdjxoxzie

Jacob Smith
Jacob Smith
10,926 Points

When I am moving from a smaller screen to a larger one my h1, h2, and nav float like they're suppose to. The actual header background becomes larger and larger and the two do not line up with each other on a desktop size screen.

1 Answer

Hey Jacob,

Try This

  nav {
    background: none;
    float: right;
    font-size: 1.125em;
    margin: 2% 0 0 0;
    width: 45%;
  }

  #logo {
    float: left;
    margin: 1%;
    width: 45%;
  }

One of your issues was that the margin from #logo was pushing the nav below the #logo element. For the nav, i just added a 2% margin to the top and 0% on all other sides. For the #logo, i just added a 1% margin all around and floated it to the left. Nav and #logo are going to take up 90% of the total width of their parent element so the other 10% can be used for margins. Optionally, you can even make the width smaller and the margins bigger.

This code was added to the @media screen and (min-width: 660px) media query.