非标
此特征是非标准的,且不在标准轨道中。不要在面向 Web 的生产站点中使用它:它不适用于每个用户。实现之间可能存在大的不兼容性,且行为将来可能改变。
-webkit-text-stroke-color
CSS property specifies the stroke
color
of characters of text. If this property is not set, the value of the
color
property is used.
/* <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: unset;
<color>
The color of the stroke.
| 初始值 |
currentcolor
|
|---|---|
| 适用于 | 所有元素 |
| 继承 | yes |
| 计算值 | computed color |
| 动画类型 | a color |
<color>where
<color> = <rgb()> | <rgba()> | <hsl()> | <hsla()> | <hex-color> | <named-color> | currentcolor | <deprecated-system-color>where
<rgb()> = rgb( <percentage>{3} [ / <alpha-value> ]? ) | rgb( <number>{3} [ / <alpha-value> ]? ) | rgb( <percentage>#{3} , <alpha-value>? ) | rgb( <number>#{3} , <alpha-value>? )
<rgba()> = rgba( <percentage>{3} [ / <alpha-value> ]? ) | rgba( <number>{3} [ / <alpha-value> ]? ) | rgba( <percentage>#{3} , <alpha-value>? ) | rgba( <number>#{3} , <alpha-value>? )
<hsl()> = hsl( <hue> <percentage> <percentage> [ / <alpha-value> ]? ) | hsl( <hue>, <percentage>, <percentage>, <alpha-value>? )
<hsla()> = hsla( <hue> <percentage> <percentage> [ / <alpha-value> ]? ) | hsla( <hue>, <percentage>, <percentage>, <alpha-value>? )where
<alpha-value> = <number> | <percentage>
<hue> = <number> | <angle>
<p>Text with stroke</p> <input type="color" value="#ff0000">
p {
margin: 0;
font-size: 4em;
-webkit-text-stroke-width: 3px;
-webkit-text-stroke-color: #ff0000; /* Can be changed in the live sample */
}
var colorPicker = document.querySelector("input");
colorPicker.addEventListener("change", function(evt) {
document.querySelector("p").style.webkitTextStrokeColor = evt.target.value;
});
| 规范 | 状态 | 注释 |
|---|---|---|
|
Compatibility Standard
The definition of '-webkit-text-stroke-color' in that specification. |
实时标准 | Initial standardization |
|
Safari CSS Reference
'-webkit-text-stroke-color' in that document. |
Non-standard unofficial documentation | Initial documentation |
| Desktop | Mobile | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
-webkit-text-stroke-color
非标
|
Chrome 完整支持 1 | Edge 完整支持 15 |
Firefox
完整支持
49
|
IE 不支持 No | Opera 完整支持 15 | Safari 完整支持 3 | WebView Android 完整支持 37 | Chrome Android 完整支持 18 |
Firefox Android
完整支持
49
|
Opera Android 完整支持 15 | Safari iOS 完整支持 2 | Samsung Internet Android 完整支持 1.0 |
完整支持
不支持
非标。预期跨浏览器支持较差。
用户必须明确启用此特征。
-webkit-text-fill-color
-webkit-text-stroke-width
-webkit-text-stroke
-webkit-border-before
-webkit-box-reflect
-webkit-line-clamp
-webkit-mask-attachment
-webkit-mask-composite
-webkit-mask-position-x
-webkit-mask-position-y
-webkit-mask-repeat-x
-webkit-mask-repeat-y
-webkit-overflow-scrolling
-webkit-tap-highlight-color
-webkit-text-fill-color
-webkit-text-stroke
-webkit-text-stroke-color
-webkit-text-stroke-width
-webkit-touch-callout
box-align
box-direction
box-flex
box-flex-group
box-lines
box-ordinal-group
box-orient
box-pack