-webkit-text-stroke-color

Baseline 已广泛支持

该特性已非常成熟,可在多种设备和浏览器版本上使用。自 2017 年 4 月以来,它已在各大浏览器上可用。

-webkit-text-stroke-color CSS 属性指定文本字符的描边颜色。如果未设置此属性,则使用 color 属性的值。

语法

css
/* <color> values */
-webkit-text-stroke-color: red;
-webkit-text-stroke-color: #e08ab4;
-webkit-text-stroke-color: rgb(200 100 0);

/* 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;

<color>

描边的颜色。

正式定义

初始值currentcolor
应用于所有元素
继承性
计算值computed color
动画类型一种颜色

正式语法

-webkit-text-stroke-color = 
<color>
此语法反映了 Compatibility 的最新标准。并非所有浏览器都可能已实现所有部分。请参阅浏览器兼容性以获取支持信息。

示例

描边颜色变化

HTML

html
<p>Text with stroke</p>
<input type="color" value="#ff0000" />

CSS

css
p {
  margin: 0;
  font-size: 4em;
  -webkit-text-stroke-width: 3px;
  -webkit-text-stroke-color: red; /* Can be changed in the live sample */
}

结果

规范

规范
兼容性
# the-webkit-text-stroke-color

浏览器兼容性

另见