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

Igor Kałużny
Igor Kałużny
4,337 Points

Navigation + logo vertical align

Hi, I'm trying to vertically align a floating logo (left) and a nav-bar (right), but the nav-bar stays always top aligned to the header container, and the logo fills 100% of height. I've replicated the workspace from the video above 2 times already but only once successfully. I have no idea what im doing wrong. Please note that in the video below any vertical alignment isnt used, but a simple float.

https://teamtreehouse.com/library/css-layout-basics/css-layout-project/adding-media-queries-for-large-screens

<header>
      <div class="container clearfix">
      <a href="index.html"><img id="logo" src="img/logo.png"></a>
        <ul id="main-nav">
          <li><a></a></li>
          <li><a></a></li>
          <li><a></a></li>
        </ul>
#logo {
  max-width: 50%;
  max-height: 80px;
  margin: 0 auto;
  display: block;
}

#main-nav {
  padding: 0;
  padding-bottom: 5px;
  margin-top: 5px;
  margin-bottom: 0;
  font-size: .8 em;
}

#main-nav a {
  padding: 10px 15px;
  display: block;
  text-align: center;
}

@media (min-width: 1025px) {

 #banner {
    padding-bottom: 40%;
}

#logo {
  float: left;
}

#main-nav {
  float: right;
  background-color: tomato;
}

#main-nav li {
  display: inline-block;
  font-size: 1.15em;
}

}