Definition and Usage
The -webkit-text-stroke-color property
property specifies the color of the text stroke.
Explore its syntax, usage, and key considerations with practical examples.
- In addition to this property, which specifies the color of the text stroke, there is the
-webkit-text-stroke-widthproperty that specifies the width of the stroke. - There is also the shorthand property
-webkit-text-strokethat specifies both properties at once.
Basic Example
TEXT STROKE
Formal syntax
selector {
-webkit-text-stroke-color: <color>
}
Syntax
/* <color> values */
-webkit-text-stroke-color: red;
-webkit-text-stroke-color: #00a0e9;
-webkit-text-stroke-color: currentcolor;
-webkit-text-stroke-color: rgba(0, 0, 0, 0.4);
/* Global values */
-webkit-text-stroke-color: inherit;
-webkit-text-stroke-color: initial;
-webkit-text-stroke-color: revert;
-webkit-text-stroke-color: revert-layer;
-webkit-text-stroke-color: unset;
Values
<color> |
The color of the text stroke. |
|---|
Formal definition
| Initial value | currentcolor (the current text color) |
|---|---|
| Applies to | all elements |
| Inherited | yes |
| Animation | yes |
Examples
<style>
.text {
font-size: 47px;
font-weight: 900;
color: white;
-webkit-text-stroke-width: 1px;
-webkit-text-stroke-color: red;
}
</style>
<p class="text">TEXT STROKE</p>
TEXT STROKE
Browser compatibility
| Property |
Desktop Chrome
|
DesktopDesktop Edge
|
Desktop Firefox
|
Safari
|
|---|---|---|---|---|
-webkit-text-stroke-color
|
1 | 15 | 49 | 3 |
Specifications
| Specification | |
|---|---|
-webkit-text-stroke-color
|
Compatibility Standard #the-webkit-text-stroke-color |
References
See also
- CSS -webkit-text-stroke Property – Styling the Stroke of Text
- CSS -webkit-text-stroke-width Property – Specifies the Stroke Width of Text
- CSS text-shadow Property – Applying Shadow Effects to Text
- CSS text-decoration Property – Shorthand for Text Decoration Styling
- CSS text-emphasis Property – Shorthand for Emphasis Marks