CSS d Property
The d property sets the path data of an SVG path element, the same as its d attribute, so paths can be changed and animated with CSS.
Description
The d property defines the path data of an SVG <path> element: the sequence of move, line, curve and arc commands that draws its shape. It is the CSS counterpart of the d attribute and takes the same path string wrapped in the path() function, for example d: path("M 10 80 Q 95 10 180 80").
Being a CSS property, the path can be swapped in media queries or on :hover, and it can be animated: when the start and end paths have the same structure (the same number and type of commands), the browser interpolates each coordinate, producing smooth morphing between shapes.
Safari parses the property but does not apply it, so keep the d attribute on the element as a fallback.
Definition
- Initial value
- none
- Applies to
- <path> elements in SVG
- Inherited
- no
- Computed value
- as specified
- Animatable
- by computed value type (paths with matching commands)
- JavaScript syntax
- object.style.d
Interactive Demo
Syntax
d: none | path(<string>);
Values
- noneThe default. No path is drawn (unless the d attribute is set).
- path(<string>)A string of SVG path commands such as
"M 10 10 L 90 90". - initialSets the property to its initial value.
- inheritTakes the computed value of the parent element.
Example
Browser Support
The following information will show you the current browser support for the CSS d property. Hover over a browser icon to see the version that first introduced support for this CSS property.
Desktop





Tablets & Mobile





