title: center div on top of img without using position
body: <p>I have a main container that contains an image and a div. What I want to achieve is to center the div on top of the image without having to use absolute or relative positioning on it. How can I achieve this? Thanks in advance.</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>.imgCon {
    display: flex;
    width: 95%;
    height: 95%;
    margin: auto;
    background-color: blue;
  }
  
  .imgCon img {
    width: 95.5%;
    height: 95%;
    margin: auto;
    border-radius: inherit;
  }
  
  .iconCon {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 30%;
    height: 30%;
    margin: auto;
    color: #ffffff;
    border-radius: 50%;
    background-color: #000000;
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;div class="imgCon"&gt;
    &lt;!--center this--&gt;
    &lt;div class="iconCon"&gt;
      C
    &lt;/div&gt;
    &lt;img src="https://www.vitalground.org/wp-content/uploads/2021/11/Bart-the-Bear-II--e1637176991443.jpg" /&gt;
  &lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>