CSS Shapes: Dividers, Triangles, Outlines & Tooltips (2026)

Clip-path shapes, triangles and section dividers, tested in Chromium 141: which shapes can animate into each other, why a border-trick triangle catches clicks in its empty corners, how one angled divider ranges from 1.8° to 13.4° across screen sizes, and what clip-path does to focus outlines.

DG
Derek Giordano
Designer & Developer

Clip-Path Shapes and What They Can Animate

clip-path hides everything outside a shape: circle(), ellipse(), inset(), polygon(), path() and the newer shape(). The clipped-away area stops receiving clicks as well; the CSS Masking spec says pointer events must not be dispatched on clipped-out regions. Build polygons visually with the Clip-Path Maker.

Transitions only work between shapes the browser can interpolate. CSS Shapes Level 1 allows it for two circles or two ellipses, two inset() values, and two polygons with the same number of points and the same fill rule; in every other case the value jumps halfway through. We animated nine pairs with the Web Animations API in Chromium 141 and read the computed value a quarter of the way in:

FromToAt 25%
circle(50%)circle(20%)circle(42.5%), interpolated
circle(50%)ellipse(40% 20%)still the circle (jumps at 50%)
inset(0)inset(20%)inset(5%), interpolated
4-point polygon()4-point polygon()interpolated
4-point polygon()6-point polygon()still the 4-point shape (jumps)
inset(0)rectangle as polygon()still the inset (jumps)
path(), 3 commandspath(), same 3 commandsinterpolated
path(), 3 commandspath(), 4 commandsstill the first path (jumps)
shape() with percentagesshape(), same commandsinterpolated (line to 87.5% 0px)

To morph between shapes with different point counts, give the simpler one extra points that sit on top of each other, so both polygons have the same count. shape() is the useful newcomer: it takes the same drawing commands as path() but accepts percentages, so the shape scales with the element. MDN's compatibility data lists it in Chrome and Edge 135 and Safari 18.4 (spring 2025) and Firefox 148 (February 2026).

Triangles: Border Trick or Clip-Path

The classic triangle is a zero-size box with thick borders: three transparent, one colored. The borders meet at the center, so a colored bottom border with transparent left and right borders draws a triangle that points up. The CSS Triangle Generator writes either version.

/* border trick: points up */
.tri { width: 0; height: 0;
  border-left: 100px solid transparent;
  border-right: 100px solid transparent;
  border-bottom: 100px solid #e33; }

/* clip-path: same triangle */
.tri { width: 200px; height: 100px; background: #e33;
  clip-path: polygon(50% 0, 100% 100%, 0 100%); }

They look identical but behave differently under the pointer. We pointed elementFromPoint() at the empty top-left corner of each: the border-trick triangle still caught the hit, because transparent borders are part of its box, while the clip-path triangle let it fall through to the parent. For a tooltip arrow that makes no difference. For a clickable triangle, such as a carousel arrow, use clip-path or an SVG so the clickable area matches what people see.

Angled Section Dividers

A diagonal cut at the bottom of a section is one line of CSS: clip-path: polygon(0 0, 100% 0, 100% 85%, 0 100%). The percentages are a share of the section's height, though, and height changes with width as text rewraps. We measured the same section, with the same copy, at three widths:

ViewportSection heightCut depth (15%)Angle
390 px620 px93 px13.4°
768 px404 px61 px4.5°
1440 px308 px46 px1.8°

The cut on a phone came out more than seven times steeper than on a desktop. To keep one angle everywhere, make the depth a share of the width instead: 100% calc(100% - 4vw) drops 4% of the viewport width across a full-width section, about 2.3° at any size. Leave bottom padding at least as deep as the cut, because clip-path hides text and buttons that fall in the cut-away triangle.

Wave and Blob Dividers

SVG waves and blobs scale cleanly and can match the next section's color exactly. Make one with the SVG Wave Generator, the Blob Shape Generator or the CSS Divider Generator, set it to width: 100% and give it the fill of the section below. Watch for the hairline seam: at 125% browser zoom, our divider tests found a 1-pixel gap along the whole edge when the SVG sat at bottom: 0, which a 1-pixel overlap removed.

Why Dividers Change What People See

Section backgrounds and dividers work through a grouping cue psychologists call common region. Stephen Palmer's 1992 experiments in Cognitive Psychology (retrieved through PubMed) showed that items sharing an enclosed region are seen as a group strongly enough to override proximity and similarity, that the smallest enclosing region wins, and that regions nest. A colored band therefore groups its contents more firmly than spacing alone, and cards inside the band read as subgroups. Beck and Palmer (2002) found people were faster to find a target pair when both items sat in the same group.

Lines are not neutral either. Across 10 studies, including one with eye tracking, Ouyang, Jia and Guo (Psychology & Marketing, 2022, found through Wiley Scholar Gateway) showed that a dividing line through a product grid made people estimate fewer products, because attention went to the top or left segment and they judged the whole from it. The effect held for horizontal and vertical lines and shifted willingness to buy and satisfaction after choosing. Put a divider where you want reading to start, not just where the layout has a gap.

Outlines, Tooltip Arrows and Aspect Ratios

Clip-path and focus rings do not mix. We focused three buttons with a 4 px red outline: the unclipped button showed 1,000 outline pixels, the button with clip-path on itself showed none, and a button whose shape came from a clipped ::before layer kept its full outline (1,608 pixels on its wider box). Put the shape on a pseudo-element or an inner element, never on the focusable element, or keyboard users lose the visible focus that WCAG 2.4.7 requires. Our outline guide covers the rest: outlines take no layout space and survive forced-colors mode, where box-shadow focus rings disappear.

The triangle on a tooltip is the easy part; the hard part is that CSS-only tooltips failed WCAG 1.4.13 (content on hover or focus) in our tooltip tests, so they need a few lines of script for Escape and hover persistence. For media boxes, aspect-ratio and the width and height attributes on images reserve space before the file loads; our aspect-ratio tests measured 225 px reserved with the attributes and 0 without.

This guide is part of the Ultimate Design Tools blog. Browse all 450+ free tools.

Browse all utility tools →
⚡ Try the free Image to CSS Art Converter →
📐
Try CSS Divider Generator
Free, no signup →