V
V
Vladislav Chernushevich2015-10-14 02:38:26
HTML
Vladislav Chernushevich, 2015-10-14 02:38:26

Is it possible to make such a grid?

Is it possible to make such a grid using only CSS, without tables and js, given that the HTML structure isf8a1b2a9a8034363bd860753634321b0.jpg

<div>
      <div class="item"></div>
      <div class="item"></div>
      <div class="item"></div>
      <div class="item"></div>
      <div class="item"></div>
      <div class="item"></div>
</div>

?

Answer the question

In order to leave comments, you need to log in

4 answer(s)
N
Nazar Mokrinsky, 2015-10-14
@nazarpc

Yes, you can with display: flex; flex-direction: column;, if HTML cannot be changed, it order: xwill help to change the order of elements as you wish.

E
Eduards Vigulis, 2015-10-14
@AIS

If the blocks and the template have a fixed width, then it can be done on floats, if the layout is rubber, then you will have to suffer, most likely it will come out in a couple of dozen media query rules.

A
Alexander Taratin, 2015-10-14
@Taraflex

w3bits.com/css-masonry

R
Rafael™, 2015-10-14
@maxminimus

Absolute positioning - replaces tables

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question