Dev Helpers
← Back

Limit a drop shadow to the shape

Limit a drop shadow to the shape with native CSS. The preview includes a small shared demo stylesheet.

Open this example in the interactive library

Source code

<style>
  .demo {
    width: 6rem;
    height: 4rem;
    clip-path: polygon(50% 0, 100% 100%, 0 100%);
  }
  .frame {
    filter: drop-shadow(0 4px 4px #33415570);
  }
</style>
<div class="frame"><div class="demo" aria-hidden="true"></div></div>