title: How to put a responsive Object fit cover, on the image Card from the Boostrap 4?
body: <p>This <code>css</code> took out the responsive layout of the Cards from the Boostrap 4. How can i put a <code>object-fit: cover;</code> on the image of the Card, and have the responsive layout from the Bootstrap 4? </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>#imgUNcover {
    width: 285px;
    height: 145px;
    -o-object-fit: cover;
    object-fit: cover;
    -o-object-position: center;
    object-position: center;
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous"&gt;
  
  &lt;div class="col-12 col-md-6 col-lg-3 mb-3 mb-md-3"&gt;
  
    &lt;div class="card"&gt;
  
      &lt;div class="img-container"&gt;
  
        &lt;a href="index.php?post=&lt;?php echo $UN['title']?&gt;"&gt;&lt;img src="&lt;?php echo $UN['capa']?&gt;" alt="&lt;?php echo $UN['alt']?&gt;" class="card-img-top" id="imgUNcover"&gt;&lt;/a&gt;
  
      &lt;/div&gt;
  
      &lt;div class="card-body"&gt;
  
        &lt;a href="index.php?post=&lt;?php echo $UN['title']?&gt;" class="card-title cardTitleLink"&gt;
          &lt;h1 class="cardTitleUN"&gt;
            &lt;?php echo $UN['title']?&gt;
          &lt;/h1&gt;
        &lt;/a&gt;
  
        &lt;p class="card-text text-muted"&gt;
          &lt;?php echo $UN['text']?&gt;
        &lt;/p&gt;
  
        &lt;a href="index.php?post=&lt;?php echo $UN['title']?&gt;" class="btn btn-outline-danger btn-sm"&gt;Continue Lendo&lt;/a&gt;
  
      &lt;/div&gt;
  
    &lt;/div&gt;
  
  &lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>Without <code>object-fit: cover;</code>:</p>
  
  <p><a href="https://i.stack.imgur.com/HTIbp.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/HTIbp.png" alt="enter image description here"></a></p>
  
  <p>With <code>object-fit: cover;</code>:</p>
  
  <p><a href="https://i.stack.imgur.com/ZtanO.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ZtanO.png" alt="enter image description here"></a></p>
  
  <p>I could change the <code>width</code> of the imagen on the id <code>#imgUNcover</code>, but it will not solve the problem in different resulution screens.</p>
  
  <p>Edit:</p>
  
  <p><a href="https://i.stack.imgur.com/CurrT.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/CurrT.png" alt="enter image description here"></a></p>