Nasi wolontariusze nie przetłumaczyli jeszcze tego artykułu na język Polski. Dołącz do nas i pomóż go przetłumaczyć!
Można także przeczytać artykuł w języku: English (US).

This is an experimental technology
Check the Browser compatibility table carefully before using this in production.

The paint-order CSS property lets you control the order in which the fill and stroke (and painting markers) of text content and shapes are drawn.

Syntax

/* Normal */
paint-order: normal;

/* Single values */
paint-order: stroke; /* draw the stroke first, then fill and markers */
paint-order: markers; /* draw the markers first, then fill and stroke */

/* Multiple values */
paint-order: stroke fill; /* draw the stroke first, then the fill, then the markers */
paint-order: markers stroke fill; /* draw markers, then stroke, then fill */

If no value is specified, the default paint order is fill, stroke, markers.

When one value is specified, that one is painted first, followed by the other two in their default order relative to one another. When two values are specified, they will be painted in the order they are specified in, followed by the unspecified one.

Note: In the case of this property, markers are only appropriate when drawing SVG shapes involving the use of the marker-* properties (e.g. marker-start) and <marker> element. They do not apply to HTML text, so in that case, you can only determine the order of stroke and fill.

Values

normal
Paint the different items in normal paint order.
stroke,
fill,
markers
Specify some or all of these values in the order you want them to be painted in.

Formal syntax

normal | [ fill || stroke || markers ]

Examples

HTML

<p>Stroke in front</p>

<p class="stroke-behind">Stroke behind</p>

CSS

p {
  font-family: sans-serif;
  font-size: 5rem;
  font-weight: bold;
  margin: 0;
  -webkit-text-stroke: 5px red;
}

.stroke-behind {
  paint-order: stroke fill;
}

Result

Specifications

Specification Status Comment
Scalable Vector Graphics (SVG) 2
The definition of 'paint-order' in that specification.
Candidate Recommendation Initial definition.

Initial valuenormal
Applies totext elements
Inheritedyes
Mediavisual
Computed valueas specified
Animation typediscrete
Canonical orderthe unique non-ambiguous order defined by the formal grammar

Browser compatibility

Update compatibility data on GitHub
DesktopMobile
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidEdge MobileFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internet
Basic support
Experimental
Chrome No support NoEdge No support NoFirefox Full support 60IE No support NoOpera No support NoSafari Full support YesWebView Android No support NoChrome Android No support NoEdge Mobile No support NoFirefox Android Full support 60Opera Android No support NoSafari iOS Full support YesSamsung Internet Android No support No

Legend

Full support  
Full support
No support  
No support
Experimental. Expect behavior to change in the future.
Experimental. Expect behavior to change in the future.

Autorzy i etykiety dokumentu

Autorzy tej strony: mfuji09, ExE-Boss, chrisdavidmills, AkashMishraa
Ostatnia aktualizacja: mfuji09,