property

shape-outside — CSS reference

Defines the float exclusion area around which inline content wraps. Initial none; not inherited. Default reference box is margin-box. It does not clip the float or resize its layout rectangle. Non-floated ordinary boxes do not acquire text wrapping.

Formal Syntax & Structure

css syntaxcss
none | [ <basic-shape> || <shape-box> ] | <image> (supported shapes vary)

Working Example

Example Snippetcss
<!doctype html><html lang="en"><meta charset="utf-8"><title>CSS masking and shapes lab</title><style>body {margin:0} .sample {background:#dcebe9;color:#182e32}body{background:white} #a{position:relative;margin:20px;width:80px;height:60px;background:red;box-sizing:content-box}#wrap{width:240px;font:16px/20px monospace} #a{float:left;position:static;margin:0;width:80px;height:80px;background:linear-gradient(to right,red 50%,transparent 50%)}#a{shape-outside:inset(0 40px 0 0)}</style><body><div id="wrap"><div id="a" aria-hidden="true"></div><span id="t">One two three four five six seven eight nine ten eleven twelve thirteen fourteen fifteen sixteen seventeen eighteen nineteen twenty.</span></div></body></html>
CSS Reference