Knowledge baseExam Center
ENEnglish
Choose language13

CKTIS / CSS

shape-outside — wrapping around a shape

The shape-outside property defines the contour that text wraps around instead of a floated element’s usual rectangular float area.

Version: CSS modules; structured CSSWG indexes reconciled with pinned MDN BCD; Chromium 152 scope gate, per-example verification still required

Syntax

shape-outside: none | [ <basic-shape> || <shape-box> ] | <image>;

shape-outside changes the wrapping area, not the element’s appearance or box model. Typical usage requires a floated element, such as float: left; text then wraps on its right. The Level 1 draft also covers initial letter boxes.

The initial value is none; the property is not inherited. Supply a shape such as circle(), a reference box, or an image. Without an explicit box, a shape uses margin-box. An image’s alpha channel determines its contour. An image specified by URL must be fetched successfully under CORS rules. Generated CSS images such as gradients are also valid values and require no fetch.

shape-margin adds clearance around the contour, but the float area remains clipped to the margin box. In the example, border-radius draws the circle while shape-outside independently controls text wrapping.

Examples

<!doctype html>
<html lang="en">
<meta charset="utf-8">
<title>shape-outside</title>
<style>
  .demo { display: flow-root; width: 360px; font: 16px/24px monospace; }
  .shape {
    float: left;
    width: 120px;
    height: 120px;
    shape-outside: circle(50%) border-box;
    border-radius: 50%;
    background: teal;
  }
  p { margin: 0; }
</style>
<div class="demo">
  <div class="shape" aria-hidden="true"></div>
  <p>One two three four five six seven eight nine ten. One two three four five six seven eight nine ten. One two three four five six seven eight nine ten. One two three four five six seven eight nine ten.</p>
</div>
</html>

Result

A teal circle appears on the left; text wraps around its right-hand curve, then uses the full container width below it.

The displayed code and declared result were verified in an isolated environment using the method recorded in the verification evidence for this exact version.

Sources