H
H
HaruAtari2014-07-29 07:34:49
css
HaruAtari, 2014-07-29 07:34:49

How to arrange content in multiple columns depending on page width?

There is a page made up on bootstrap. Holds tiles. These tiles should be arranged in several columns, so that the number of columns varies depending on the width of the page.
First I did this:

<div class="col-md-4 col-sm-4">
  <div class="tile">...</div>
  <div class="tile">...</div>
  <div class="tile">...</div>
</div>
<div class="col-md-4 col-sm-4">
  <div class="tile">...</div>
  <div class="tile">...</div>
  <div class="tile">...</div>
</div>
<div class="col-md-4 col-sm-4">
  <div class="tile">...</div>
  <div class="tile">...</div>
  <div class="tile">...</div>
</div>

It turns out three columns, and when viewed from a mobile device, they are located one under the other into one. But you need to have two columns on the tablets. And I have no idea how to organize them.
Tell me how to do it?
3c0c831aa1894349a94e2f86773b3050.png
bd6665d33fbd4327983fa86afda34ebe.png
fe5580349eb74d34b9caadcbf0aca685.png

Answer the question

In order to leave comments, you need to log in

3 answer(s)
A
Alexander David, 2014-07-29
@alexdevid

<div class="col-md-4 col-sm-6 col-xs-6">...</div>
somehow
jsfiddle.net/u9naX

E
Eugene, 2014-07-29
@cyber-jet

As you wrote, using media queries will not work, you can only do this:
1 2 3
4 5 6
...
1 2
3 4
...
1
2
..

A
Alexey, 2014-07-29
@TsSaltan

And if so ?
There you can move the slider and see how the blocks will be displayed depending on the screen size

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question