Answers for "how to arrange many images in a web page using css"

0

how to sort image in html into a 2x2 grid

<style>
.container {
  display: flex;
  flex-wrap: wrap;
}

.container .image {
  width: 50%;
}

.container img {
  width: calc(100% - (20px * 2));
  margin: 20px;
}
</style>
<div class="container">
  <div class="image">
    <img src="http://placehold.it/50" />
  </div>
  <div class="image">
    <img src="http://placehold.it/50" />
  </div>
  <div class="image">
    <img src="http://placehold.it/50" />
  </div>
  <div class="image">
    <img src="http://placehold.it/50" />
  </div>
</div>
Posted by: Guest on July-18-2020

Code answers related to "how to arrange many images in a web page using css"

Browse Popular Code Answers by Language