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!
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
Justin Hicks
14,290 Pointscss layout basics columns not cooperating
The layout challenge I did my way and then watched the video to see if that would help me get the columns right but even comparing my code with the code in the video I still cant get the columns to cooperate. Any help is appreciteted!
7 Answers

Idan Melamed
16,285 PointsNoticed another thing... The clearfix class should be in the parent container...
So try switching
<div class="secondary col">
<div class="container clearfix">
With
<div class="container clearfix">
<div class="secondary col">

Justin Hicks
14,290 PointsThat did provide a different result but its still not corrected entirely, but at 5:20 AM I'm going to take a break from it lol. Thank you for your helpful suggestions.

Justin Hicks
14,290 PointsI finally figured it all out, I had left off the closing div for the .secondary but I also had left out 2 closing curly braces in the css which was causing my problems. Thanks for your help Idan, you made me realize i was making typos :-)

Idan Melamed
16,285 PointsHi Justin, Did you add the class .clearfix to the parent container?

Justin Hicks
14,290 PointsI did, if you like I can add the html code as well?

Idan Melamed
16,285 Pointsplease do :-)

Justin Hicks
14,290 Points<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Best City Guide</title>
<link href='https://fonts.googleapis.com/css?family=Varela+Round' rel='stylesheet' type='text/css'>
<link rel="stylesheet" href="css/normalize.css">
<link rel="stylesheet" href="css/style.css">
</head>
<body>
<header class="main-header">
<div class="container, clearfix">
<h1 class="name"><a href="#">Best City Guide</a></h1>
<ul class="main-nav">
<li><a href="#">ice cream</a></li>
<li><a href="#">donuts</a></li>
<li><a href="#">tea</a></li>
<li><a href="#">coffee</a></li>
</ul>
</div><!---- Container ---->
</header><!--/.main-header-->
<div class="banner">
<img class="logo" src="img/city-logo.svg" alt="City">
<h1 class="headline">The Best City</h1>
<span class="tagline">The best drinks and eats in the best city ever.</span>
</div><!--/.banner-->
<div class="secondary col">
<div class="container, clearfix">
<h2>Welcome!</h2>
<p>Everything in this city is worth waiting in line for.</p>
<p>Cupcake ipsum dolor sit. Amet chocolate cake gummies jelly beans candy bonbon brownie candy. Gingerbread powder muffin. Icing cotton candy. Croissant icing pie ice cream brownie I love cheesecake cookie. Pastry chocolate pastry jelly croissant.</p>
<p>Cake sesame snaps sweet tart candy canes tiramisu I love oat cake chocolate bar. Jelly beans pastry brownie sugar plum pastry bear claw tiramisu tootsie roll. Tootsie roll wafer I love chocolate donuts.</p>
<div class="primary col">
<h2>Great food</h2>
<img class="feat-img" src="img/treats.svg" alt="Drinks and eats">
<p>Croissant macaroon pie brownie. Cookie marshmallow liquorice gingerbread caramels toffee I love chocolate. Wafer lollipop dessert. Bonbon jelly beans pudding dessert sugar plum. Marzipan toffee dragée chocolate bar candy toffee pudding I love. Gummi bears pie gingerbread lollipop.</p>
</div><!--/.primary-->
<div class="tertiary col">
<h2>How to get here</h2>
<p><strong>Plane: </strong>Tiramisu caramels gummies chupa chups lollipop muffin. Jujubes chocolate caramels cheesecake brownie lollipop dragée cheesecake.</p>
<p><strong>Train: </strong>Pie apple pie pudding I love wafer toffee liquorice sesame snaps lemon drops. Lollipop gummi bears dessert muffin I love fruitcake toffee pie.</p>
<p><strong>Car: </strong>Jelly cotton candy bonbon jelly-o jelly-o I love. I love sugar plum chocolate cake pie I love pastry liquorice.</p>
</div><!----/Container---->
</div><!--/.tertiary-->
<footer class="main-footer">
<span>©2015 Residents of The Best City Ever.</span>
</footer>
</body>
</html>```

Justin Hicks
14,290 Pointswow sorry about the mess I just made adding code

Idan Melamed
16,285 Pointsone small syntax error I noticed is this:
<div class="container, clearfix">
.
.
.
<div class="container, clearfix">
Try removing the commas and see if it helps.

Justin Hicks
14,290 PointsI've tried it with and without but it still does the same thing. Even using developer tools to inspect, it doesnt make sense why its behaving the way it is.

Justin Hicks
14,290 PointsI just noticed that when i change the width in a small section that controls the primary and secondary column width the columns are not expanding into 2 instead they stay stacked leaving the width to 50% with the rest being left to the html element. even the footer only takes 50% up?
.primary,
.secondary {
width: 50%;
}```
Justin Hicks
14,290 PointsJustin Hicks
14,290 PointsSorry forgot the code lol