stroke-dasharray property
Sets or retrieves one or more values that indicate the pattern of dashes and gaps used to stroke paths.
![]() ![]() |
Syntax
stroke-dasharray: none | dasharray | inherit
Property values
none-
Default. Indicates that no dashed lines are used. If stroked, the line is drawn solid.
dasharray-
A list of comma or white space separated lengths (which can have a unit identifier) and percentages that specify the lengths of alternating dashes and gaps. If an odd number of values is provided, the list of values is repeated to yield an even number of values. A percentage represents a distance as a percentage of the current viewport. A negative value is an error. If the sum of the values is zero, the stroke is rendered as if a value of none was specified.
inherit-
Indicates that the property takes the same computed value as the property for the element's parent.
CSS information
| Applies To | shapes and text content elements |
|---|---|
| Media | visual |
| Inherited | 1 |
| Initial Value | none |
Standards information
Remarks
As of Microsoft Edge, this presentation attribute is animatable with CSS Animations and CSS Transitions.
See also
- CSSStyleDeclaration
- currentStyle
- style
- SVGCircleElement
- SVGEllipseElement
- SVGLineElement
- SVGPathElement
- SVGPolygonElement
- SVGPolylineElement
- SVGRectElement
- SVGTextElement
- SVGTextPathElement
- SVGTSpanElement
- Reference
- stroke
- strokeDashoffset
- strokeLinecap
- strokeLinejoin
- strokeMiterlimit
- strokeOpacity
- strokeWidth

