Dev Helpers
← Back

Emphasize the first rendered line

Emphasize the first rendered line with native CSS. The preview includes a small shared demo stylesheet.

Open this example in the interactive library

Source code

<style>
  .demo {
    max-width: 22ch;
  }
  .demo::first-line {
    font-weight: 700;
  }
</style>
<p class="demo">
  A first-line style follows the line break even when the paragraph wraps
  differently.
</p>