CSS

-webkit-text-stroke-width

-webkit-text-stroke-width

非标准

此功能是非标准的,不处于标准轨道上.。不要在面向Web的生产站点上使用它:它并不适用于每个用户。实现之间也可能存在很大的不兼容性,而且这种行为在未来可能会发生变化。

-webkit-text-stroke-width CSS属性指定的行程为文本的宽度。

初始值0
适用元素all elements
是否是继承属性yes
适用媒体visual
计算值absolute <length>
动画类型discrete
正规顺序the unique non-ambiguous order defined by the formal grammar

语法

/* Keyword values */ -webkit-text-stroke-width: thin; -webkit-text-stroke-width: medium; -webkit-text-stroke-width: thick; /* <length> values */ -webkit-text-stroke-width: 2px; -webkit-text-stroke-width: 0.1em; -webkit-text-stroke-width: 1mm; -webkit-text-stroke-width: 5pt; /* Global values */ -webkit-text-stroke-width: inherit; -webkit-text-stroke-width: initial; -webkit-text-stroke-width: unset;

<line-width>笔划的宽度。

正式语法

<length>

示例

CSS内容

p { margin: 0; font-size: 4em; -webkit-text-stroke-color: red; } #thin { -webkit-text-stroke-width: thin; } #medium { -webkit-text-stroke-width: 3px; } #thick { -webkit-text-stroke-width: 1.5mm; }

HTML内容

<p id="thin">Thin stroke</p> <p id="medium">Medium stroke</p> <p id="thick">Thick stroke</p>

规范

SpecificationStatusComment
Web Compatibility StandardThe definition of '-webkit-text-stroke-width' in that specification.Living StandardInitial standardization
Safari CSS Reference '-webkit-text-stroke-width' in that document.Non-standard unofficial documentationInitial documentation

浏览器兼容性

FeatureChromeEdgeFirefox (Gecko)Internet ExplorerOperaSafari
Basic support(Yes)(Yes)48.0 (48.0)1No support(Yes)(Yes)

FeatureAndroidEdgeFirefox Mobile (Gecko)IE MobileOpera MobileSafari Mobile
Basic support?(Yes)48.0 (48.0)1No support??