v149 · CSS · path() Wrapping Demo

path() Wrapping Demo

Float elements with shape-outside: path(…) and watch text flow around custom curves. Pick a shape to see how SVG path commands produce text-wrapping contours not possible with the basic shape functions.

Checking whether this browser exposes shape-outside: path()

live demo

Shape:
shape-outside: path('M 0 0 Q 70 40 0 80 Q 70 120 0 160 L 140 160 L 140 0 Z')
wave
path()
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium totam rem aperiam eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo.

code

/* Wave contour using quadratic bezier curves */
.float {
  float: right;
  width: 140px;
  height: 160px;
  /* shape-outside now accepts the same path() syntax as clip-path */
  shape-outside: path('M 0 0 Q 70 40 0 80 Q 70 120 0 160 L 140 160 L 140 0 Z');
  clip-path:     path('M 0 0 Q 70 40 0 80 Q 70 120 0 160 L 140 160 L 140 0 Z');
}

/* Text wraps the wave contour — no SVG element needed */

see also

implementation reference

Need the exact API surface, compatibility boundaries, errors, lifecycle, and source links? Read the matching gendn reference ↗