CSS paint-order Property
Example
Change paint order for an SVG <circle> element:
circle {
paint-order: stroke fill;
}
Try it Yourself »
More "Try it Yourself" examples below.
Definition and Usage
The paint-order
property specifies the order of how an SVG element or text is painted.
Note: Only the order of stroke and fill can be changed for text elements, because markers are not applicable.
Default value: | normal |
---|---|
Inherited: | yes |
Animatable: | no. Read about animatable |
Version: | CSS3 |
JavaScript syntax: | object.style.paintOrder="stroke fill" Try it |
Browser Support
The numbers in the table specify the first browser version that fully supports the property.
Property | |||||
---|---|---|---|---|---|
paint-order | 35.0 | 17.0 | 60.0 | 8.0 | 22.0 |
CSS Syntax
paint-order: normal|one value|two values|three values|initial|inherit;
Property Values
Value | Description | Demo |
---|---|---|
normal | Default value. The paint order is fill, stroke, markers. | Demo ❯ |
one value | Painting will start with given value, then continue with the remaining painting in default order. If only "stroke" is given, the next painting activity is fill, then markers. | Demo ❯ |
two values | Painting will start with given values, then continue with the remaining painting in default order. If "stroke markers" are given, the next painting activity will be fill. | Demo ❯ |
three values | Painting will be done according to given values. | Demo ❯ |
initial | Sets this property to its default value. Read about initial | |
inherit | Inherits this property from its parent element. Read about inherit |
More Examples
Example
Change the paint order on an SVG <text> element with rainbow gradient fill:
text {
paint-order: stroke fill;
}
Try it Yourself »
Related Pages
SVG Tutorial: SVG Tutorial
HTML SVG Graphics: HTML SVG Graphics