翻译不完整。 请帮助我们翻译这篇文章!
摘要
-webkit-text-stroke CSS属性为文本字符指定了宽 和 颜色 . 它是-webkit-text-stroke-width 和-webkit-text-stroke-color属性的缩写.
语法
/* 宽度和颜色属性 */ -webkit-text-stroke: 4px navy; /* 全局属性 */ -webkit-text-stroke: inherit; -webkit-text-stroke: initial; -webkit-text-stroke: unset;
值
<length>- 文本宽.
<color>- 文本颜色.
常规用法
/* 设置宽度和颜色 */ -webkit-text-stroke: <length> <color>; /* 默认设置 */ -webkit-text-stroke: inherit/initial/unset;
用例
HTML
<p id="example">The stroke of this text is red.</p>
CSS
#example {
font-size: 3em;
margin: 0;
-webkit-text-stroke: 2px red;
}
规格
| Specification | Status | Comment |
|---|---|---|
| Compatibility Standard -webkit-text-stroke |
Living Standard | 初始标准化 |
| Safari CSS Reference '-webkit-text-stroke' in that document. |
不标准非官方文件 | 初始定义 |
浏览器兼容
兼容情况一览表
| Feature | Chrome | Firefox (Gecko) | Internet Explorer | Opera | Safari |
|---|---|---|---|---|---|
| Basic support | 4 | 48.0 (48.0)[1] | 未实现 | 15 | 3.1 |
| Feature | Android | Firefox Mobile (Gecko) | IE Mobile | Opera Mobile | Safari Mobile |
|---|---|---|---|---|---|
| Basic support | 4 | 48.0 (48.0)[1] | 未实现 | 36 | 4.1 |
[1] This feature is implemented behind the preference layout.css.prefixes.webkit, defaulting to false. Since Gecko 49 (Firefox 49.0 / Thunderbird 49.0 / SeaMonkey 2.46) the preference defaults to true.