<div class="post">
  <h2>Title</h2>
</div>
.post {
  container-type: inline-size;
}

@container (min-width: 480px) {
  .post h2 {
    font-size: 3em;
  }
}
Run Pen

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.