I'm using layout horizontal wrap
to locate some items based on its size and the container. These items have different sizes so, sometimes, I'm losing a lot of space below them.
Better if I show you a sketch with the situation...
My relevant code looks like:
<style>
.high {
height: 200px;
}
.low {
height: 50px;
}
.object {
min-width: 200px;
}
</style>
<div class="layout horizontal wrap" style="height:auto" id="container">
<div class="object high">
<p>1</p>
</div>
<div class="object low">
<p>2</p>
</div>
<div class="object low">
<p>3</p>
</div>
<div class="object low">
<p>4</p>
</div>
</div>
<script type="text/javascript">
$(function() {
$("#container").sortable({
cursor: "move"
});
});
</script>
Those elements are sortable, so the user can move them. A solution with fixed positions is not possible.
Is it possible to resolve it using polymer-shadow? Any idea?
I did a plnkr where you can reproduce it
Update
As I´m getting some suggestions to use float and I'm getting some difficulties to explain the problem I'm having with it, I'm adding a new sketch to show a possible goal. Notice how the user could move the small items at both sides of the big one.
float: left
, but it doesn't allow me to have multiple small objects at the left side of a big one (1st column items 2,3,4. 2nd column item 1). I've modify the plunkr with this fork plnkr.co/edit/7fm9zO?p=preview . – Paroleefloat
ordisplay: inline-block
, check out my answer I explained why you can't do it usingfloat
here: #5235249 – Liberalism