text-stroke property
The text-stroke property specifies a
color and width of text character outline or
stroke. The property takes the text-stroke-width
value (border width) and text-stroke-color
(border color).
Syntax
selector {
text-stroke: stroke width and color;
}
Example
Let's set a white stroke for characters in
our text with the width of 1px:
<p>
Text
</p>
body {
width: 200px;
height: 100px;
}
p {
-webkit-text-stroke: 1px white;
text-stroke: 1px white;
background-color: #467CBC;
padding: 10px;
font-size: 30px;
font-weight: bold;
font-family: Arial;
}
:
See also
-
the
text-fill-colorproperty
that sets a fill color for text characters -
the
text-stroke-colorproperty
that sets a color of text stroke -
the
text-stroke-widthproperty
that sets a text stroke width