user1610383
user1610383

Reputation: 25

Why won't the div slide up under the above div?

I'm working on this dashboard and can't seem to get container 3 to slide up under container 1, can any one spot why?

Upvotes: 0

Views: 142

Answers (3)

Systembolaget
Systembolaget

Reputation: 2514

Even better, you may want to look at Masonry's "big brother" Isotope which can arrange layouts in even more ways; yet is simple to implement. Also works very well on mobile touch screen devices.

Upvotes: 0

Pevara
Pevara

Reputation: 14310

This is normal behaviour when working with floats. To solve this, you could eather resort to javascript, or change the formating of your html. Something like this should work:

<div class="col">
 <div id="container1">...</div>
 <div id="container3">...</div>
</div>
<div class="col">
 <div id="container2">...</div>
 <div id="container4">...</div>
</div>

when you now float the col instead of the containers you should get the desired effect.

Upvotes: 1

xec
xec

Reputation: 18024

What you linked to is basically just a demonstration of how css floats work. There's no straight-forward fix to make floats act differently, but you might want to take a look at masonry, a javascript solution: http://masonry.desandro.com/

Upvotes: 0

Related Questions