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

Justin Bansal
Justin Bansal
1,228 Points

Two column layout issues with footer in between

Having issues where I'm doing responsive design for the minimum width of 480px and when I expand the browser, the two column layout appears with the content from the footer in between.

''' <html> <head> <meta charset="utf-8"> <title>Justin Bansal | Designer</title> <link rel="stylesheet" href="css/normalize.css"> <link href='http://fonts.googleapis.com/css?family=Changa+One|Open+Sans:400italic,700italic,400,700,800' 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>Justin Bansal</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 Information</h3> <p>I am not currently looking for new design work, but I am available for speaking gigs and similar engagements. If you have any questions, please don't hesitate to contact me!</p> <p>Please only use phone contact for urgent inquiries. Otherwise, Twitter and email are the best way to reach me.</p> </section> <section id="secondary"> <h3>Contact Details</h3> <ul class="contact-info"> <li class="phone"><a href="tel:416-6425">416-6425</a></li> <li class="mail"><a href="mailto:justin@example.com">justin@example.com</a></li> <li class="twitter"><a href="http://twitter.com/intent/tweet?screen_name=justinbansal">@justinbansal</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="#"><img src="img/facebook-wrap.png" alt-"Facebook Logo" class="social-icon"></a> <p>Ā© 2015 Justin Bansal.</p> </footer> </div> </body> </html> '''

''' css

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

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

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

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

}

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

}'

'''

2 Answers

Thas Eagans
PLUS
Thas Eagans
Courses Plus Student 2,533 Points

You need to clear the footer.

/*css code */
footer {
 clear: both;
}

I'm not sure how the assignment wants you to clear it, but you definitely need to use clear on the footer to prevent it from being affected by the floats.

</TREagans>

Justin Bansal
Justin Bansal
1,228 Points

Hey thank you so much for the quick response!

I was skeptical thinking this forum was inactive and that the videos were from years ago. It's my first time learning on here and I can see that there's an actual community willing to support one another :)

I ended up realizing that I missed part of a lesson and that's where they go over clearing the footer. It was missing from my main css so I added it now and it works great. Thank you again!

Thas Eagans
PLUS
Thas Eagans
Courses Plus Student 2,533 Points

You're welcome, and glad you figured it out.

</TREagans>