MDN’s new design is in Beta! A sneak peek: https://blog.mozilla.org/opendesign/mdns-new-design-beta/

-webkit-text-stroke

这篇翻译不完整。请帮忙从英语翻译这篇文章

 

摘要

 -webkit-text-stroke CSS属性为文本字符指定了 和 颜色 . 它是-webkit-text-stroke-width-webkit-text-stroke-color属性的缩写.

语法

/* Width and color values */
-webkit-text-stroke: 4px navy;

/* Global values */
-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
Web 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.

参考文档

文档标签和贡献者

 此页面的贡献者: Vera0707
 最后编辑者: Vera0707,