← Back to Overview Chapter 08: Clip-Path

1. Geometric Polygon & Circle Presets

clip-path clips an element to a basic shape (circle, ellipse, polygon) or an SVG path.

circle() circle(50%)
Triangle polygon(3 points)
Chevron Arrow indicator
Star polygon(10 points)
Hexagon polygon(6 points)
Speech Bubble Tail marker
.circle   { clip-path: circle(50% at 50% 50%); }
.triangle { clip-path: polygon(50% 0%, 0% 100%, 100% 100%); }
.star     { clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%); }

2. Slanted / Angled Section Dividers

Modern landing pages often break monotony with angled section dividers using clip-path: polygon(0 0, 100% 0, 100% 85%, 0 100%);.

Dynamic Slanted Section

Instead of boring horizontal lines, angled clipping gives websites modern energy and movement.

Content beneath the slanted section continues naturally in normal document flow.

.slanted-section {
    background: linear-gradient(135deg, #008080, #0d9488);
    clip-path: polygon(0 0, 100% 0, 100% 85%, 0 100%);
    padding-bottom: 60px; /* Offset the diagonal angle */
}

3. Curving Text with shape-outside

Unlike standard floats which only wrap text around a bounding rectangle, shape-outside: circle(50%); causes inline text to wrap around the actual circular curve of the image!

Scissors

CSS Shapes allow web designers to wrap content around custom geometric paths. In editorial magazine layouts, text frequently hugs circular portraits and organic contours. With shape-outside: circle(50%) and float: left, the browser recalculates line box intersections, smoothly bending paragraphs along the arc of the circle. Try resizing your browser window to observe how dynamically the fluid typography responds to the curved clipping boundary!

.float-circle {
    float: left;
    width: 120px;
    height: 120px;
    shape-outside: circle(50%); /* Text curves around circle! */
    clip-path: circle(50%);     /* Clips element visually */
    margin-right: 20px;
}
Fixed 🏠