CSS TICKET & COUPON SHAPE GENERATOR
Cut ticket-style notches and a perforation line into any block and copy the CSS.
In short
Generate the CSS for a ticket or coupon shape with half-circle notches cut into the sides, the top and bottom, or the corners, plus an optional dashed perforation line. You get a ready-to-paste .ticket class built from radial-gradient masks that keeps the notches see-through on any background. It runs in your browser and nothing is uploaded.
.ticket {
width: 360px;
height: 140px;
background: repeating-linear-gradient(to right, #201d19 0 6px, transparent 6px 12px) 0 calc(70% - 1px) / 100% 2px no-repeat,
#ffb347;
-webkit-mask: radial-gradient(circle 14px at 0 70%, #0000 98%, #000) left / 51% 100% no-repeat,
radial-gradient(circle 14px at 100% 70%, #0000 98%, #000) right / 51% 100% no-repeat;
mask: radial-gradient(circle 14px at 0 70%, #0000 98%, #000) left / 51% 100% no-repeat,
radial-gradient(circle 14px at 100% 70%, #0000 98%, #000) right / 51% 100% no-repeat;
}Example output (default settings)
.ticket {
width: 360px;
height: 140px;
background: repeating-linear-gradient(to right, #201d19 0 6px, transparent 6px 12px) 0 calc(70% - 1px) / 100% 2px no-repeat,
#ffb347;
-webkit-mask: radial-gradient(circle 14px at 0 70%, #0000 98%, #000) left / 51% 100% no-repeat,
radial-gradient(circle 14px at 100% 70%, #0000 98%, #000) right / 51% 100% no-repeat;
mask: radial-gradient(circle 14px at 0 70%, #0000 98%, #000) left / 51% 100% no-repeat,
radial-gradient(circle 14px at 100% 70%, #0000 98%, #000) right / 51% 100% no-repeat;
}<div class="ticket">
<!-- your ticket or coupon content here -->
</div>How to make a ticket shape
- 1
Pick where the notches go: sides, top and bottom, or the corners.
- 2
Set the notch radius, its position along the edge, and the ticket size.
- 3
Choose the ticket color and turn the dashed perforation line on or off.
- 4
Copy the CSS and HTML and paste them into your page.
Questions
- Why use a mask instead of circles in the background color?
- Painting circles in the page's background color only works on a solid background. A radial-gradient mask actually removes pixels from the element, so the notches stay transparent over photos, gradients, and dark mode alike.
- Why are the mask layers 51% wide instead of 50%?
- Each notch is drawn on its own half of the element. Making each half 51% leaves a small overlap so no one-pixel seam appears in the middle on fractional widths, while the notch circle still sits exactly on the edge.
- Does the CSS work in Safari and older browsers?
- The output sets both -webkit-mask and the standard mask shorthand, which covers current Chrome, Edge, Firefox, and Safari. Browsers that do not support masks simply show a plain rectangle.
- Can I put text and content inside the ticket?
- Yes. Put your content inside the .ticket element. The mask only clips the notches away, so text near a notch can be hidden — add padding at least as large as the notch radius around the edges that have notches.
- How does the perforation line line up with the notches?
- The dashed line is an extra background layer placed at the same percentage as the notches, so with side notches it runs horizontally between them and with top and bottom notches it runs vertically. It is not drawn for the corner style.
Related tools
- CSS Mask / Fade Edge GeneratorFade out the edges of an image or block with a mask-image gradient — top, bottom, sides, or all edges — and copy the CSS.
- CSS Animated Glowing Border GeneratorBuild a rotating conic-gradient border that chases around a card, with adjustable speed, thickness, and glow blur.
- CSS Gradient Border GeneratorBuild a rounded gradient border with 2-5 color stops using the padding-box/border-box trick, and copy the CSS.
- CSS Speech Bubble GeneratorBuild a chat-style speech bubble with a border-trick tail on any side, and copy the CSS.
- CSS Clip-Path GeneratorDrag points on a live preview to build a clip-path: polygon() shape from a preset or from scratch, and copy the CSS.
- CSS Squircle GeneratorBuild an iOS-style continuous-curve squircle from a superellipse formula rendered as a clip-path polygon, and copy the CSS.
- CSS CRT / Scanlines / VHS GeneratorBuild a retro CRT screen overlay with scanlines, vignette, phosphor tint, and flicker animation, then copy the CSS.
- CSS Link Underline Effects GeneratorBrowse a gallery of 10 hover underline effects for links — slide in, center out, double line, dot grow, and more.
Updated