Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Align div depends on the space avaialble

I have the div alignment as show below. I don't need the formal table-like layout. I need DIV5 to use the space below DIV2 (marked in red). I'm using Bootstrap framework and I need a generic solution so that whereever I use that, the div elements will be align appropriately.

enter image description here

Kindly help. Thanks in advance.

like image 715
Raja Asthana Avatar asked Jan 24 '26 03:01

Raja Asthana


1 Answers

Twitter bootstrap's grid system isn't fluid, cascading or whatever you want to call it. I assume you have there two '.row' divs with columns and those accept only 12 columns on a row and that's it - rows won't overlap.

You should try using something like Masonry (http://masonry.desandro.com/), with or without bootstrap. With bootstrap you could create the Masonry grid inside of row > col-lg-12 like this

<div class="container">
    <div class="row">
        <div class="col-lg-12">
            Masonry grid plugin here.
        </div>
    </div>
</div>
like image 159
mMoovs Avatar answered Jan 25 '26 21:01

mMoovs



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!