freecoding.school100% FREE · NO SIGNUP
Neon DistrictISSUE #14 of 50

clip-path · cropping with shapes

PrismaVSJank the Janitor
Prisma saysclip-path crops an element to a shape — polygon, circle, inset, or an SVG path.

clip-path hides everything outside a shape: circle(50%), inset(10px), or polygon(...) for angled cuts. The visible area still occupies its box; only rendering is clipped. It makes angled dividers, hexagon avatars, and reveal animations (it's animatable).

Power-ups you unlock

Jank the Janitor attacks — common mistakes

Boss battleClip an element into a hexagon with polygon().

Example code

<!doctype html><html><head><meta charset="utf-8">
<style>.hex{width:140px;height:140px;background:#b388ff;clip-path:polygon(25% 0,75% 0,100% 50%,75% 100%,25% 100%,0 50%)}</style></head><body style="background:#06040d;padding:20px"><div class="hex"></div></body></html>
▶ Open the interactive comic issue
‹ Mix-Blend-Mode · Stacking BlendMask · Alpha + Image Masking ›