5 properties, 8 functions, 1 type defined by this
specification, 12 of them known to at least one browser
(the others are badged Not in any browser yet).
<section class="default-example" id="default-example"> <div class="example-container"> <div class="transition-all" id="example-element"></div> We had agreed, my companion and I, that I should call for him at his house, after dinner, not later than eleven o'clock. This athletic young Frenchman belongs to a small set of Parisian sportsmen, who have taken up "ballooning" as a pastime. After having exhausted all the sensations that are to be found in ordinary sports, even those of "automobiling" at a breakneck speed, the members of the "Aéro Club" now seek in the air, where they indulge in all kinds of daring feats, the nerve-racking excitement that they have ceased to find on earth. </div></section>
Syntax
<opacity-value>
Formal grammar from the specification, as webref extracts it: the latest level's definition, sometimes ahead of what browsers implement.
Definition
Initial
0
Applies to
floats
Inherited
no
Percentages
n/a
Computed value
specified number, clamped to the range [0,1]
Canonical order
per grammar
Animation type
by computed value
Browser support
First browser version supporting shape-image-threshold
Chrome
37
Edge
79
Firefox
62
Safari
10.1
Chrome Android
37
Safari iOS
10.3
First version with support, from MDN browser-compat-data.
<section class="default-example" id="default-example"> <div class="example-container"> <div class="transition-all" id="example-element"></div> We had agreed, my companion and I, that I should call for him at his house, after dinner, not later than eleven o'clock. This athletic young Frenchman belongs to a small set of Parisian sportsmen, who have taken up "ballooning" as a pastime. After having exhausted all the sensations that are to be found in ordinary sports, even those of "automobiling" at a breakneck speed, the members of the "Aéro Club" now seek in the air, where they indulge in all kinds of daring feats, the nerve-racking excitement that they have ceased to find on earth. </div></section>
Syntax
<length-percentage [0,∞]>
Formal grammar from the specification, as webref extracts it: the latest level's definition, sometimes ahead of what browsers implement.
Definition
Initial
0
Applies to
floats and initial letter boxes
Inherited
no
Percentages
refer to the inline size of the containing block
Computed value
computed <length-percentage> value
Canonical order
per grammar
Animation type
by computed value
Browser support
First browser version supporting shape-margin
Chrome
37
Edge
79
Firefox
62
Safari
10.1
Chrome Android
37
Safari iOS
10.3
First version with support, from MDN browser-compat-data.
MDN The shape-outsideCSS property defines a shape—which may be non-rectangular—around which adjacent inline content should wrap. By default, inline content wraps around its margin box; shape-outside provides a way to customize this wrapping, making it possible to wrap text around complex objects rather than rectangular boxes.
<section class="default-example" id="default-example"> <div class="example-container"> <img class="transition-all" id="example-element" src="https://developer.mozilla.org/shared-assets/images/examples/round-balloon.png" width="150" /> We had agreed, my companion and I, that I should call for him at his house, after dinner, not later than eleven o'clock. This athletic young Frenchman belongs to a small set of Parisian sportsmen, who have taken up "ballooning" as a pastime. After having exhausted all the sensations that are to be found in ordinary sports, even those of "automobiling" at a breakneck speed, the members of the "Aéro Club" now seek in the air, where they indulge in all kinds of daring feats, the nerve-racking excitement that they have ceased to find on earth. </div></section>
Syntax
none | [ <basic-shape> || <shape-box> ] | <image>
Formal grammar from the specification, as webref extracts it: the latest level's definition, sometimes ahead of what browsers implement.
Definition
Initial
none
Applies to
floats and initial letter boxes
Inherited
no
Percentages
n/a
Computed value
as defined for <basic-shape> (with <shape-box> following, if supplied); else the computed <image>; else the keyword as specified
Canonical order
per grammar
Animation type
as defined for <basic-shape>, otherwise discrete
Browser support
First browser version supporting shape-outside
Chrome
37
Edge
79
Firefox
62
Safari
10.1
Chrome Android
37
Safari iOS
10.3
First version with support, from MDN browser-compat-data.
MDN The inset()CSS function defines a rectangle at the specified inset distances from each side of the reference box. It is a basic shape function used to define one of the basic-shapedata types.
MDN The polygon()CSS function is one of the basic-shapedata types. It's used to draw a polygon by providing one or more pairs of coordinates, each of which represents a vertex of the shape.
MDN The rect()CSS function creates a rectangle at the specified distance from the top and left edges of the containing block. It is a basic shape function of the basic-shapedata type. You can use the rect() function in CSS properties such as offset-path to create the rectangular path along which an element moves, in clip-path to define the shape of the clipping region, and in border-shape to define the shape of an element's border.
MDN The shape()CSS function is used to define a shape for the border-shape, clip-path, and offset-path properties. It combines an initial starting point with a series of shape commands that define the path of the shape. The shape() function is a member of the basic-shape data type.
Live previewExample from MDN
body { align-items: center; justify-content: center; display: flex;}.container { position: relative; display: inline-block; width: 250px; height: 250px; border: 2px dotted green; margin: 20px;}@supports not (offset-path: shape(from 0 0, move to 0 0)) { body::after { content: "Your browser doesn't support the `shape()` function yet."; background-color: wheat; display: block; text-align: center; padding: 1rem 0; }}.shape { width: 50px; height: 50px; background: #2bc4a2; position: absolute; text-align: center; line-height: 50px; animation: move 6s infinite linear;}.shape1 { offset-path: shape( from 30% 60px, curve to 180px 180px with 90px 190px, close, move by 0px 150px, hline by 40% );}.shape2 { offset-path: shape( from 50px 90px, hline to 8em, move to 50px 90px, vline by 20%, close );}@keyframes move { 0% { offset-distance: 0%; } 100% { offset-distance: 100%; background-color: hotpink; }}
<div class="container"> Using <code><curve-command></code> <div class="shape shape1">>></div></div><div class="container"> Using <code><move-command></code> and <code><hvline-command></code> <div class="shape shape2">>></div></div>
Syntax
/* for <basic-shape> */
shape( <'fill-rule'>? from <position> , <shape-command># )
Formal grammar from the specification, as webref extracts it: the latest level's definition, sometimes ahead of what browsers implement.
Browser support
First browser version supporting shape()
Chrome
135
Edge
135
Firefox
148
Safari
18.4
Chrome Android
135
Safari iOS
18.4
First version with support, from MDN browser-compat-data.
Defined for
<basic-shape>
This feature only appears in the context of these properties, functions or types.
MDN The xywh()CSS function creates a rectangle using the specified distances from the left (x) and top (y) edges of the containing block and the specified width (w) and height (h) of the rectangle. It is a basic shape function of the basic-shapedata type. You can use the xywh() function in CSS properties such as offset-path to create the rectangular path along which an element moves, in clip-path to define the shape of the clipping region, and in border-shape to define the shape of an element's border.