I
I
Igor Vasiliev2017-07-18 00:34:17
css
Igor Vasiliev, 2017-07-18 00:34:17

How to make nice sorting of images in a rectangle?

Hello dear programmers.
--
I want to thank all those who helped me with the previous questions, you helped me a lot. Here the question is more creative than IT. In general, there is a script that makes a beautiful tile from images.
sapegin.github.io/jquery.mosaicflow
There are actually a lot of them, but the trouble with these tiles is that they are hard buggy when adapting. Everything works well on the computer monitor and laptop, but as soon as it comes to the phone, this is a real disaster. I can work with some individual objects through css3 @media, but that's not all, in the example you can see that the bottom of the image tile is like the end of torn paper. Some people may like it, but not me.
QUESTION:
How to make such an adaptive tile:
66e191614a2e4edb9d67a259fd1c3ff2.png

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Mikhail Zakharov, 2017-07-18
@Isolution666

This can be done on flex. Just copy)

<div id="gallery">
  <img src="1.jpg" alt>
  <img src="2.jpg" alt>
  <img src="3.jpg" alt></div>

And to these blocks the following css:
div#gallery {
  display: -ms-flexbox;
  -ms-flex-direction: column;
  -ms-flex-wrap: wrap;
  display: flex;
  flex-direction: column;
  flex-wrap: wrap;
  height: 100vw;
  font-size: 0; 
}
div#gallery img { 
  width: 33.3%;
  transition: .8s opacity;
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question