<div class="container">
  <main id="main">
    <div class="card">
      <figure class="card__thumbnail">
        <img src="https://images.unsplash.com/photo-1519046904884-53103b34b206?ixid=MXwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHw%3D&ixlib=rb-1.2.1&auto=format&fit=crop&w=1500&q=80" alt="Awesome Headline goes here" />
      </figure>
      <div class="card__body">
        <h3 class="card__title">Awesome Headline goes here</h3>
        <div class="card__content">
          <p>I really love CSS. And it's getting better and better everyday. What would I do without it? Ican not imagine.</p>
        </div>
      </div>
      <div class="card__footer">
        <button class="button__primary">Go somewhere</button>
      </div>
    </div>
    <div class="card">
      <figure class="card__thumbnail">
        <img src="https://images.unsplash.com/photo-1519046904884-53103b34b206?ixid=MXwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHw%3D&ixlib=rb-1.2.1&auto=format&fit=crop&w=1500&q=80" alt="Awesome Headline goes here" />
      </figure>
      <div class="card__body">
        <h3 class="card__title">Awesome Headline goes here</h3>
        <div class="card__content">
          <p>I really love CSS. And it's getting better and better everyday. What would I do without it? Ican not imagine.</p>
        </div>
      </div>
      <div class="card__footer">
        <button class="button__primary">Go somewhere</button>
      </div>
    </div>
    <div class="card">
      <figure class="card__thumbnail">
        <img src="https://images.unsplash.com/photo-1519046904884-53103b34b206?ixid=MXwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHw%3D&ixlib=rb-1.2.1&auto=format&fit=crop&w=1500&q=80" alt="Awesome Headline goes here" />
      </figure>
      <div class="card__body">
        <h3 class="card__title">Awesome Headline goes here</h3>
        <div class="card__content">
          <p>I really love CSS. And it's getting better and better everyday. What would I do without it? Ican not imagine.</p>
        </div>
      </div>
      <div class="card__footer">
        <button class="button__primary">Go somewhere</button>
      </div>
    </div>
  </main>
  <aside id="aside">
    <div class="card">
      <figure class="card__thumbnail">
        <img src="https://images.unsplash.com/photo-1519046904884-53103b34b206?ixid=MXwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHw%3D&ixlib=rb-1.2.1&auto=format&fit=crop&w=1500&q=80" alt="Awesome Headline goes here" />
      </figure>
      <div class="card__body">
        <h3 class="card__title">Awesome Headline goes here</h3>
        <div class="card__content">
          <p>I really love CSS. And it's getting better and better everyday. What would I do without it? Ican not imagine.</p>
        </div>
      </div>
      <div class="card__footer">
        <button class="button__primary">Go somewhere</button>
      </div>
    </div>
    <div class="card">
      <figure class="card__thumbnail">
        <img src="https://images.unsplash.com/photo-1519046904884-53103b34b206?ixid=MXwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHw%3D&ixlib=rb-1.2.1&auto=format&fit=crop&w=1500&q=80" alt="Awesome Headline goes here" />
      </figure>
      <div class="card__body">
        <h3 class="card__title">Awesome Headline goes here</h3>
        <div class="card__content">
          <p>I really love CSS. And it's getting better and better everyday. What would I do without it? Ican not imagine.</p>
        </div>
      </div>
      <div class="card__footer">
        <button class="button__primary">Go somewhere</button>
      </div>
    </div>
  </aside>
</div>

<form>
  <div class="control">
    <label for="root-fs">font-size(Root):</label>
    <input type="range" id="root-fs" name="root-fs" min="50" max="200" step="2" value="100" />
    <output for="root-fs" id="root-fs-output">100%</output>
  </div>
  <div class="control">
    <label for="main-fs">font-size(Main):</label>
    <input type="range" id="main-fs" name="main-fs" min="0.8" max="2" step="0.05" value="1" />
    <output for="main-fs" id="main-fs-output">1rem</output>
  </div>
  <div class="control">
    <label for="aside-fs">font-size(Aside):</label>
    <input type="range" id="aside-fs" name="main-fs" min="0.5" max="1.5" step="0.05" value="0.75" />
    <output for="aside-fs" id="aside-fs-output">0.75rem</output>
  </div>
</form>
@import url("https://fonts.googleapis.com/css2?family=Exo:wght@600&display=swap");

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
  object-position: center;
  object-fit: cover;
}

body {
  width: 100vw;
  min-height: 100vh;
  font-family: "Exo", Arial, sans-serif;
  background-color: #222;
  color: #fefefe;
  gap: 10px;
  padding: 10px;
  display: grid;
}

html {
  transition: font-size 0.4s ease-out;
}

.container {
  display: grid;
  grid-template-columns: 1fr 20em;
  align-items: flex-start;
}

main {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(20em, 1fr));
  justify-items: center;
  gap: 1em 2em;
}

aside .card {
  margin: 0 auto 2em;
}

aside .card + .card {
  margin-bottom: 0;
}

.card {
  width: 100%;
  max-width: 25em;
  box-shadow: 0 0 0.25em -0.15em rgba(255, 255, 255, 0.65);
  border-radius: 0.25em;
  border: 0.025em solid rgba(255, 255, 255, 0.65);
  background-color: #fefefe;
  color: #444;
}
.card__thumbnail {
  margin: 0;
  border-radius: 0.275em 0.275em 0 0;
  overflow: hidden;
}

.card__thumbnail img {
  border-radius: 0.275em 0.275em 0 0;
}

.card__body {
  font-size: 1.125em;
  line-height: 1.5;
  padding: 1em 1.25em;
}

.card__title {
  font-size: 1.5em;
  margin: 0 0 0.5em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card__content {
  font-size: 1.025em;
  line-height: 1.5;
  hyphens: auto;
}

.card__footer {
  padding: 0.6em 1.25em 1.2em;
  text-align: right;
}

.button__primary {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  font-weight: 700;
  cursor: pointer;
  user-select: none;
  background-color: #0d6efd;
  border: 0.025em solid #0d6efd;
  color: #fff;
  padding: 0.625em 1.25em;
  font-size: 1em;
  border-radius: 0.25em;
  transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out,
    border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.button__primary:hover {
  background-color: #0b5ed7;
  border-color: #0a58ca;
}

.button__primary:focus {
  background-color: #0b5ed7;
  border-color: #0a58ca;
  box-shadow: 0 0 0 0.25em rgba(49, 132, 253, 0.5);
}

.button__primary:active {
  background-color: #0a58ca;
  border-color: #0a53be;
}

:root {
  --fs: 1rem;
  --root-fs: 100%;
}

html {
  font-size: var(--root-fs);
}

.card {
  font-size: var(--fs);
}

aside {
  --fs: 0.65rem;
}

form {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  background: #333333dd;
  color: #fff;
  padding: 20px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 20px;
  font-size: 20px;
}

.control {
  display: flex;
  align-items: center;
  gap: 5px;
}

output {
  color: #f36;
  text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.25);
}
const rootElement = document.documentElement;
const mainElement = document.getElementById("main");
const asideElement = document.getElementById("aside");

const rootFsHandler = document.getElementById("root-fs");
const mainFsHandler = document.getElementById("main-fs");
const asideFsHander = document.getElementById("aside-fs");

const rootFsOutput = document.getElementById("root-fs-output");
const mainFsOutput = document.getElementById("main-fs-output");
const asideFsOutput = document.getElementById("aside-fs-output");

rootFsHandler.addEventListener("input", (evt) => {
  const rootRangeVal = evt.target.value;

  rootFsOutput.innerText = `${rootRangeVal}%`;
  rootElement.style.setProperty("--root-fs", `${rootRangeVal}%`);
});

mainFsHandler.addEventListener("input", (evt) => {
  const mainRangeVal = evt.target.value;

  mainFsOutput.innerText = `${mainRangeVal}rem`;
  mainElement.style.setProperty("--fs", `${mainRangeVal}rem`);
});

asideFsHander.addEventListener("input", (evt) => {
  const asideRangeVal = evt.target.value;

  asideFsOutput.innerText = `${asideRangeVal}rem`;
  asideElement.style.setProperty("--fs", `${asideRangeVal}rem`);
});
View Compiled

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.