Dev Helpers
← Back

Focus within legend emphasis

Focus within legend emphasis with native CSS. The preview includes a small shared demo stylesheet.

Open this example in the interactive library

Source code

<style>
  .demo:focus-within legend {
    font-weight: 700;
    text-decoration: underline;
  }
</style>
<fieldset class="demo">
  <legend>Pickup</legend>
  <label>Date <input type="date" /></label>
</fieldset>