Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

have a number of child level div wrap in a fixed height parent div

have a number of child level div wrap in a fixed height parent div

Problem

I have a Parent Div of height 100 px but full width (default). Inside it I have a lot of 20px by 20px divs. When the child divs are about to reach the bottom, I want the next ones to start wrapping. That is, they should start displaying alongside to the right. In other words I don't want scrolling to happen. But wrapping.

............
Problem courtesy of: dreamerkumar

Solution

You can use CSS3 columns - http://jsfiddle.net/spbqh/

#parent {
    -webkit-column-count: 3;
       -moz-column-count: 3;
            column-count: 3;

    background: #eee;
}

div > div {
    height: 20px;
    width: 20px;
    background: beige;
}
Solution courtesy of: Zoltan Toth

Discussion

View additional discussion.



This post first appeared on CSS3 Recipes - The Solution To All Your Style Problems, please read the originial post: here

Share the post

have a number of child level div wrap in a fixed height parent div

×

Subscribe to Css3 Recipes - The Solution To All Your Style Problems

Get updates delivered right to your inbox!

Thank you for your subscription

×