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 Build a Three Column Layout

Trying to figure out why my footer images are floating to the right. Please help!

<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title> Stanley Abraham | Designer |</title> <link rel="stylesheet" href="css/._normalize.css"> <link href='http://fonts.googleapis.com/css?family=PT+Sans' rel='stylesheet' type='text/css'> <link rel="stylesheet" href="css/main.css"> <link rel="stylesheet" href="css/responsive.css"> </head> <body> <header> <a href="index.html" id="logo"> <h1>Stanley Abraham</h1> <h2>Designer</h2> </a> <nav> <ul> <li><a href="index.html"> Portfolio</a></li> <li><a href="about.html" >About</a></li> <li><a href="contact.html" class="selected">Contact</a></li> </ul> </nav> </header> <div id="wrapper"> <section id="primary"> <h3>General Info</h3> <p> If you need help with any projects,I am availible for work. If you have any questions, please don't hesitate to contact me!</p> <p>Please only use phone contact for emergency inquiries. I can be best reach via email or tweeter.</p> </section> <section id="secondary"> <h3>Contact Details</h3> <ul class="contact-info"> <li class="phone"> <a href="tel:857-654-4134">857-654-4134</a></li> <li class="mail"> <a href="mailto:Stan773@gmail.com"> Stan773@gmail.com</a></li> <li class="twitter"> <a href="http://twitter.com/intent/tweet?screen_name=standaman777"> @StanDaMan777</a></li> </ul> </section> <footer> <a href="https://www.facebook.com/stanley.abraham.560"><img src="img/facebook-wrap.png" alt="Facebook Logo" class="social-icon"></a> <a href="http://instagram.com/standaman777"><img src="img/instagram-logo.png" alt="Instagram Logo" class="social-icon"></a> <a href="https://twitter.com/StanDaMan777"><img src="img/twitter-wrap.png" alt="Twitter Logo" class="social-icon"></a> <p> Socail media links</p> <p>Ā© 2014 Stanley Abraham</p> </footer> </div>
</body>
</html>

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

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

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

  #secondary {
    width: 40%;
    width: 40%;
    float: right;
    }
  }
@media screen and (min-width: 660px) {

}

http://port-80-hvtgzcti4d.treehouse-app.com/contact.html

EDIT: Press edit to see what i did to achieve the highlighting effect on your CSS code. If you have more code, the forum will suck it and hide it, aslo it will be easier for us to look at it and copy to make any changes if needed. Please take a little to make code reading better

2 Answers

Hi Stanley,

Have you tried using the 'clear' property? This is ideal for elements such as footers. In your CSS you might try something like

#footer {
  clear: both;
  }

also this link has a good 'at a glance summary of what is happening there...

http://css-tricks.com/almanac/properties/c/clear/

Hope that helps

Your images are not floating to the right. The img element is an inline element (it does not insert a new line on a page), meaning that text and other elements can wrap around it.

So what you are seeing is:

<img><img><img>

I'm guessing you want is:

<img>
<img>
<img>

There are several ways to achieve this. One way would be to give the images a css style to change its display to "block". Like this:

<img style="display:block;">

You can also wrap them in an element that, by default, has its display to block. Like in a div or li tag. Like this:

<div>
    <img>
</div>

or

<ul>
  <li>img</li>
</ul>

Also, you are not selecting your classes correctly. In your HTML, where your images are you have class="social-icon", yet in your CSS you are calling #primary and #secondary.