-webkit-text-stroke-color

CSS 属性 -webkit-text-stroke-color 指定了文本字符的笔触颜色。若未设置此属性,则使用 color 属性的值。

css
/* 颜色值 */
-webkit-text-stroke-color: red;
-webkit-text-stroke-color: #e08ab4;
-webkit-text-stroke-color: rgb(200, 100, 0);

/* 全局值 */
-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
适用元素all elements
是否是继承属性yes
计算值computed color
Animation typea color

形式语法

-webkit-text-stroke-color = 
<color>

示例

改变笔触颜色

HTML

html
<p>带笔触的文本</p>
<input type="color" value="#ff0000" />

CSS

css
p {
  margin: 0;
  font-size: 4em;
  -webkit-text-stroke-width: 3px;
  -webkit-text-stroke-color: #ff0000; /* 可在运行实例中被修改 */
}

结果

规范

Specification
Compatibility Standard
# the-webkit-text-stroke-color

浏览器兼容性

BCD tables only load in the browser

参见