coderef

rect() and xywh()Baseline · Widely available

The rect() CSS function creates a rectangle shape with insets from the edges of an element. The xywh() CSS function creates a rectangle shifted by an x and y distance. They can be used with clip-path and shape-outside.

Supported in all major browsers for at least 30 months — safe to use without fallbacks. Baseline since Jan 23, 2024. Widely available since Jul 23, 2026.

Browser support

DesktopChrome
1–118Not supported
119+Supportedsince Oct 31, 2023
Current: 155
Edge
12–118Not supported
119+Supportedsince Nov 2, 2023
Current: 154
Firefox
1–121Not supported
122+Supportedsince Jan 23, 2024
Current: 157
Safari
1–17.1Not supported
17.2+Supportedsince Dec 11, 2023
Current: 27
MobileChrome Android
18–118Not supported
119+Supportedsince Oct 31, 2023
Current: 155
Firefox Android
4–121Not supported
122+Supportedsince Jan 23, 2024
Current: 157
Safari iOS
1–17.1Not supported
17.2+Supportedsince Dec 11, 2023
Current: 27

How to use

This feature is Baseline widely available — use it freely, no fallback needed.

Example

Full syntax and examples are on MDN: rect.

Feature detection

There’s no simple runtime check for this feature; rely on the support table and test in your target browsers.

Sub-features

Support for each part of the feature (2). The overall table above shows when the whole feature works.

Sub-featureChromeEdgeFirefoxSafariChrome AndroidFirefox AndroidSafari iOS
<basic-shape>.rect11911912217.211912217.2
<basic-shape>.xywh11911912217.211912217.2