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 CSS Layout Techniques Display Modes Column Layout with Inline-Block

Bob Sutherton
Bob Sutherton
20,160 Points

Why are my columns not aligning?

I am going to link to my code pen. There are two issues that I keep having. The first is that my columns aren't aligning like Guil's are in this video. The second one is why my ".wrapper" div keeps collapsing instead of going to full height of the page?

Any help is greatly appreciated. Thanks!

http://codepen.io/brockcallahan/pen/mdHev/

4 Answers

Hi James, when you add padding, it makes the col wider, so your 60 40 split becomes greater than 100. Use width and add margins, not padding.

Bob Sutherton
Bob Sutherton
20,160 Points

Thanks. That did work, although I am a little confused as to why Guil was able to add padding and not me. I was only copying what he did. Also, would you care to take a shot at why my ".wrapper" div is collapsing?

Without seeing your code, I'm assuming that you don't have enough content to fill it. You can add width and height dimensions to keep it from collapsing.

Mario Zampollo
Mario Zampollo
11,292 Points

Maybe it could be because you are using the box model, instead of declaring box-sizing property to the value border-box. Try to check this out: http://css-tricks.com/box-sizing.