Dev Helpers
← Back

Show a background only inside padding

Show a background only inside padding with native CSS. The preview includes a small shared demo stylesheet.

Open this example in the interactive library

Source code

<style>
  .demo {
    border: 5px dashed #547089;
    background-color: #bae6fd;
    background-clip: padding-box;
  }
</style>
<div class="demo">Show a background only inside padding</div>