Skip to main content
CSS Tip

A CSS-only Zig-Zag edge

How much code is needed to create a Zig-Zag edge?

Use an online generator to easily get the code: css-generators.com/custom-borders

A CSS-only zig-zag border

.zig-zag {
mask: conic-gradient(from -45deg at bottom,#000 90deg,#0000 0) 50% / 60px 100%;
}

See the Pen CSS only Zig-Zag edge by Temani Afif (@t_afif) on CodePen.

More detail: css-tricks.com/css-borders-using-masks