Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

HTML

.profile-photo not floating left

this is driving me crazy. i've tried everything I can think of.

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

  /**********************************
  TWO COLUMN LAYOUT
  ***********************************/

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

  #secondary {
    width: 40%;
    float: right;
  }
}



  /**********************************
  PAGE: PORTFOLIO
  ***********************************/

  #gallery li {
    width: 28.3333%;
  }

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

/**********************************
PAGE: PORTFOLIO
***********************************/  
  .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: 5%;
    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;
  }
Jennifer Nordell
seal-mask
.a{fill-rule:evenodd;}techdegree
Jennifer Nordell
Treehouse Teacher

Try moving your media query to the very bottom of your CSS file. I'm thinking something is overwriting your float.

3 Answers

@Jennifer Nordell that was a good idea but it still didn't work :(

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

  /**********************************
  TWO COLUMN LAYOUT
  ***********************************/

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

  #secondary {
    width: 40%;
    float: right;
  }
}



  /**********************************
  PAGE: PORTFOLIO
  ***********************************/

  #gallery li {
    width: 28.3333%;
  }

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

/**********************************
PAGE: PORTFOLIO
***********************************/  
  .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: 5%;
    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;
  }
Jennifer Nordell
seal-mask
.a{fill-rule:evenodd;}techdegree
Jennifer Nordell
Treehouse Teacher

That's your CSS not your HTML. But I'll do what I can to help. You've got some extraneous closed curly braces to begin with.

  #secondary {
    width: 40%;
    float: right;
  }
} /*  Remove this curly brace */

 .profile-photo {
    float:left;  /* Try adding a space here  ... float: left; */
    margin: 0 5% 80px 0;
  } 
} /* Remove this curly brace */

Also, while CSS isn't generally very picky about spacing ... there are occasions when something won't work because a space is either exists or lacking. Try placing a space between your float:left. Ie float: left.

Jennifer Nordell

HTML from my about page:

<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <title>Amy Turbyfill | Designer</title>
    <link rel="stylesheet" href="css/normalize.css">
    <link href='https://fonts.googleapis.com/css?family=Changa+One|Open+Sans:400,400italic,700italic,800' rel='stylesheet' type='text/css'>
    <link rel="stylesheet" href="css/main.css">
    <link rel="stlyesheet" href="css/responsive.css">
  </head>
  <body>
    <header>
      <a href="index.html" id="logo">
        <h1>Amy Turbyfill</h1>
        <h2>Designer</h2>
      </a>
      <nav>
        <ul>
          <li><a href="index.html" >Portfolio</a></li>
          <li><a href="about.html" class="selected">About</a></li>
          <li><a href="contact.html">Contact</a></li>
        </ul>
      </nav>
    </header>
    <div id="wrapper">
      <section>
          <img src="img/chicken.jpg" alt="photograph of Amy Turbyfill" class="profile-photo">
        <h3>About</h3>
          <p>Hi, I'm Amy Turbyfill! This is my design portfolio where I share all my favorite work. When I'm not designing things, I enjoy exercising, playing video games, drinking good coffee, and more.</p>
        <p>If you'd like to follow me on Twitter, my username is <a href="http://twitter.com/aturbyfi">@aturbyfi</a>.</p>
      </section>
      <footer>
      <a href= "http://twitter.com/aturbyfi"><img src="img/twitter-wrap.png" alt="Twitter Logo"  class="social-icon"></a>
      <a href="http://facebook.com/amy.turbyfill"><img src="img/facebook-wrap.png" alt="Facebook Logo" class="social-icon"></a>
      <p>&copy; 2016 Amy Turbyfill.</p>
    </footer>
      </div>
  </body>
</html>