title: How to make a responsive image grid which changes image size depending on the amount of images?
body: <p>I'm trying to make a responsive grid of images which makes the images smaller when there are multiple next to each other and larger when there is, for instance, only one image.</p>
  
  <p><em>(For better understanding here below are some photos of expected results)</em></p>
  
  <p><strong>Photo 1:</strong></p>
  
  <p><a href="https://i.stack.imgur.com/zsDab.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/zsDab.jpg" alt="enter image description here"></a></p>
  
  <p><strong>Photo 2:</strong></p>
  
  <p><a href="https://i.stack.imgur.com/ntyow.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ntyow.jpg" alt="enter image description here"></a></p>
  
  <p>I've tried playing with the max-width and min-width and using various display modes but no luck. Furthermore, I've tried looking on the internet but no luck there too. </p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-css lang-css prettyprint-override"><code>.photos .content {
    width: 70%;
    min-height: 100%;
    margin-left: 15%;
    background-color: #F5F5F5;
  }
  
  .photos .content .grid {
    display: overflow: none;
  }
  
  .photos img {
    max-width: 30%;
    min-width: 25%;
    height: 30%;
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;div class="panel photos"&gt;
    &lt;div class="content" id="photos"&gt;
      &lt;div class="grid"&gt;
        &lt;img src="img/sample-images/sample1.jpg"&gt;
        &lt;img src="img/sample-images/sample2.jpg"&gt;
        &lt;img src="img/sample-images/sample3.jpg"&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>