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

Scott Yardley
Scott Yardley
20,663 Points

When I float the profile picture to the left, it makes the text, and profile pic appear to be cramped to together.

When I float the profile picture to the left in my responsive.css, it makes the text, and profile pic appear to be cramped to together. I don't know what i'm doing wrong. Here's my code...

@media screen and (min-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: ABOUT ***************************/

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

}

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

}

Samuel Ferree
Samuel Ferree
31,722 Points

You might need to apply some clearfix, can you post your html?

Scott Yardley
Scott Yardley
20,663 Points

Here's my html

<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>Nick Pettit | Designer</title> <link rel="stylesheet" href="css/normalize.css"> <link rel="stylesheet" href="css/main.css"> <link rel="stylesheet" href="css/responsive.css"> <body> <header> <a href="index.html" id="logo"> <h1>Nick Pettit</h1> <h2>Designer</h2> </a> <nav> <ul> <li><a href="index.html" class="selected">Portfolio</a></li> <li><a href="about.html">About</a></li> <li><a href="contact.html">Contact</a></li> </ul> </nav> </header> <div id="wrapper"> <section> <ul id="gallery"> <li> <a href="img/numbers-01.jpg"> <img src="img/numbers-01.jpg" alt=""> <p>Experimentation with color and texture.</p> </a> </li> <li> <a href="img/numbers-02.jpg"> <img src="img/numbers-02.jpg" alt=""> <p>Playing with blending modes in Photoshop.</p> </a> </li> <li> <a href="img/numbers-06.jpg"> <img src="img/numbers-06.jpg" alt=""> <p>Trying to create an 80's style of glows.</p> </a> </li> <li> <a href="img/numbers-09.jpg"> <img src="img/numbers-09.jpg" alt=""> <p>Drips created using Photoshop brushes.</p> </a> </li> <li> <a href="img/numbers-12.jpg"> <img src="img/numbers-12.jpg" alt=""> <p>creating shapes using repitition.</p> </a> </li> </ul> </section> <footer> <a href="http://twitter.com/nickrp"><img src="img/twitter-wrap.png" alt="Twitter Logo"class="social-icon"></a> <a href="http://facebook.com/Nick Pettit"><img src="img/facebook-wrap.png" alt="Facebook Logo"class="social-icon"></a> <p>© 2016 Nick Pettit.</p> </footer> </div> </body> </html>

1 Answer

Samuel Ferree
Samuel Ferree
31,722 Points

You have some errors in your html, not sure if it's causing the float errors you're seeing, but you should fix these first.

Your head tag is missing a closing tag

  <head>
    <!-- Head content goes here -->
  </head>

Additionally, the css you've posted targets two html elements with id's "primary" and "secondary" But your html contains no elements with these id's

Scott Yardley
Scott Yardley
20,663 Points

I just realized what I was doing wrong I had the responsive.css placed before the main.css instead of after. Like this. <link rel="stylesheet" href="css/normalize.css"> <link rel="stylesheet" href="css/responsive.css"> <link rel="stylesheet" href="css/main.css">

Although thank you for pointing out those other errors I had. they helped with some other problems I was having