<!-- Use preprocessors via the lang attribute! e.g. <template lang="pug"> -->
<template>
  <div id="app">
    <div class="container row">
      <div class="card">
        <div class="media padding-top-16-0"></div>
        <h2>With hack 😎</h2>
      </div>
      <div class="card">
        <div class="media no-hack"></div>
        <h2>Without it 😢</h2>
      </div>
    </div>
  </div>
</template>

<!-- Use preprocessors via the lang attribute! e.g. <style lang="scss"> -->
<style>
#app {
  font-family: Avenir, Helvetica, Arial, sans-serif;
  text-align: center;
  color: #2c3e50;
  margin-top: 60px;
}

a,
button {
  color: #4fc08d;
}
.container {
  margin: 0 auto;
  max-width: 800px;
  display: flex;
  justify-content: space-around;
}
.card {
  overflow: hidden;
  width: 45%;
  background: white;
  border: 1px solid #e5e5e5;
  min-height: 300px;
  border-radius: 10px;
  box-shadow: 0 4px 25px 0px rgb(0 0 0 / 20%);
}

.media {
  background: url("https://res.cloudinary.com/alvarosaburido/image/upload/v1613494470/as-portfolio/Youtube_-_Thumbail_Create_modals_with_Vue3_Teleport_TailwindCSS_rughpn.png");
  background-size: cover;
}

.padding-top-16-0 {
  padding-top: 56.25%;
  height: 0;
  overflow: hidden;
}

.no-hack {
  min-height: 200px;
}

h2 {
  padding: 1rem;
  text-align: left;
}

img {
  width: 100%;
}

button {
  background: none;
  border: solid 1px;
  border-radius: 2em;
  font: inherit;
  padding: 0.75em 2em;
}
</style>

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.