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

Xavier Patterson
PLUS
Xavier Patterson
Courses Plus Student 890 Points

Why isn't my nav logo <a #logo> tag floating left all the way? html is good, I'm guessing it has to do with my css.

This is my html:

<a href="index.html" id="logo">
      <h1>Xavier Patterson</h1>
      <h2>Designer</h2>
    </a>

this is my css that pertains to the nav:

@media screen and (min-width: 480px){


  /****************** 
  Two column layout
  ******************/

  #primary {
    width: 50%;
    float: left;
  }

  #secondary {
  width: 40%;
  float: right;  
  }
    /****************** 
  3 * 5 = 15
  ******************/
  /****************** 
  Page: Portfolio
  ******************/

  #gallery li {
    width: 28.3333%;
  }

  #gallery li:nth-child(4n) {
    clear: left;
  }

  /****************** 
  Page: About
  ******************/

  .profile-photo {
    float: left;
    margin: 0 5% 80px 0;
  }


}


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


  h1 {
  font-size: 2.5em;
  }


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

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

}
Wayne Priestley
Wayne Priestley
19,579 Points

Hi Xavier,

I've edited your code so it appears correct in your post.

Here is a link to explain how to use Markdown to post your code How to post code If you look at the bottom of the box when your typing a reply you will see Markdown Cheatsheet that will also explain how to post your code

Hope this helps.

1 Answer

Hi Xavier,

You look to have a margin-left of 45% on your floated logo which will mean it won't display all the way to the left side.

#logo { float: left; margin-left: 45%; text-align: left; width: 45%; }

Hope that helps.

-Rich

Xavier Patterson
Xavier Patterson
Courses Plus Student 890 Points

You're a beast man!!! thnx. I must've copied and pasted wrong, but for the life of me i couldn't see it.

No problem, glad I could help.