← All elements

Receipt Zigzag Edge

by @admin · 11 views

<article class="pc-receipt">
  <h3>Order #4821</h3>
  <ul>
    <li><span>Linen Tee</span><span>₱1,200</span></li>
    <li><span>Canvas Tote</span><span>₱650</span></li>
    <li><span>Shipping</span><span>₱0</span></li>
  </ul>
  <p class="pc-receipt__total"><span>Total</span><span>₱1,850</span></p>
</article>

About this card

An order receipt with a torn zigzag bottom edge cut by a conic-gradient mask, so it works on any background colour.

How it works

The receipt is a white box with a two-part mask. One layer covers all of the box except the bottom 8px. A repeating conic-gradient forms a row of triangles in the last 8px, so the bottom edge is cut into a zigzag. Masks make the notches truly transparent, so it works on any background colour.

Ways to customise it

  • Change 16px in the mask size to make wider or narrower teeth.
  • Change the monospace font stack for another receipt look.
  • Add more li rows for more items.

Good to know

Masks are supported in all current browsers, and the code includes the prefixed property for older WebKit. Because the notches are cut out and not painted, a drop-shadow filter on a parent will follow the zigzag.

Open an example, copy the HTML and the CSS, and paste them into your page. There is nothing to install and no JavaScript to load.

More in Cards

View all →