title: Text over image in javascript and css
body: <p>I am trying to add text over a set of dynamic images that I have added with Javascript.</p>
  <p>I have a loop in JavaScript that adds images that are located in an AWS by looping with an index i.
  I'd like to add the value of the index i in the bottom right side of each picture (hence, a dynamic tag based on the value of the index i).</p>
  <p>I have <a href="https://codepen.io/aoliva/pen/YEerWQ?editors=1111" rel="nofollow noreferrer">this</a> so far.</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-js lang-js prettyprint-override"><code>function getRandomSize(min, max) {
    return Math.round(Math.random() * (max - min) + min);
  }
  
  var allImages = "";
  
  for (var i = 1; i &lt; 40; i++) {
    var width = getRandomSize(200, 400);
    var height = getRandomSize(200, 400);
  
    allImages += '&lt;img src= "https://s3.amazonaws.com/testimagesupload1120/' + i + '.jpg"&gt;';
  }
  
  $('#photos').append(allImages);</code></pre>
  <pre class="snippet-code-css lang-css prettyprint-override"><code>#photos {
    /* Prevent vertical gaps */
    line-height: 0;
    -webkit-column-count: 5;
    -webkit-column-gap: 0px;
    -moz-column-count: 5;
    -moz-column-gap: 0px;
    column-count: 5;
    column-gap: 0px;
  }
  
  #photos img {
    /* Just in case there are inline attributes */
    width: 100% !important;
    height: auto !important;
  }
  
  @media (max-width: 1200px) {
    #photos {
      -moz-column-count: 4;
      -webkit-column-count: 4;
      column-count: 4;
    }
  }
  
  @media (max-width: 1000px) {
    #photos {
      -moz-column-count: 3;
      -webkit-column-count: 3;
      column-count: 3;
    }
  }
  
  @media (max-width: 800px) {
    #photos {
      -moz-column-count: 2;
      -webkit-column-count: 2;
      column-count: 2;
    }
  }
  
  @media (max-width: 400px) {
    #photos {
      -moz-column-count: 1;
      -webkit-column-count: 1;
      column-count: 1;
    }
  }
  
  body {
    margin: 0;
    padding: 0;
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;section id="photos"&gt;&lt;/section&gt;</code></pre>
  </div>
  </div>
  </p>