Your Web News in One Place

Help Webnuz

Referal links:

Sign up for GreenGeeks web hosting
December 27, 2013 09:30 pm GMT

Make Sure Your Columns Dont Collapse Horizontally

You might be familiar with elements collapsing vertically. If an element only contains other elements that are floated, the parent element will collapse to zero height. We often employ the clear fix for that. But if an element doesn't contain anything, it can collapse horizontally as well, which can be quite awkward for layout.

Here's an example of some HTML for a three-column layout.

<div class="grid grid-bad"> <div class="col col-1-3"></div> <div class="col col-1-3"></div> <div class="col col-1-3"> I'm the last column. …


Make Sure Your Columns Don’t Collapse Horizontally is a post from CSS-Tricks


Original Link: http://css-tricks.com/make-sure-columns-dont-collapse-horizontally/

Share this article:    Share on Facebook
View Full Article

CSS Tricks

A Web Design Community curated by Chris Coyier

More About this Source Visit CSS Tricks