Is it possible to do without js to make it like this: Grid of pictures

  • So you can do it - uorypm
  • img {float: left; } - ilyaplot
  • use flex-box - slippyk

1 answer 1

There are many options. You can use float, you can use the pseudo-element after at the end of the list of pictures that will stretch them evenly, or you can use text-align: justify, for example:

<style> .img { text-align: justify; -moz-text-align-last: justify; text-align-last: justify; padding: 5px; } .img img { width: 150px; height: 150px; margin: 5px; } </style> <div class="img"> <img src="" alt=""/> <img src="" alt=""/> <img src="" alt=""/> </div>