-webkit-text-stroke-color

Baseline 已廣泛支援

該特性已非常成熟,可在多種裝置和瀏覽器版本上使用。自 2017 年 4 月以來,它已在各大瀏覽器上可用。

-webkit-text-stroke-color CSS 屬性指定文字字元的描邊顏色。如果未設定此屬性,則使用 color 屬性的值。

語法

css
/* <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: revert;
-webkit-text-stroke-color: revert-layer;
-webkit-text-stroke-color: unset;

<color>

描邊的顏色。

正式定義

初始值currentcolor
應用於所有元素
繼承性
計算值computed color
動畫型別一種顏色

正式語法

-webkit-text-stroke-color = 
<color>
此語法反映了 Compatibility 的最新標準。並非所有瀏覽器都可能已實現所有部分。請參閱瀏覽器相容性以獲取支援資訊。

示例

描邊顏色變化

HTML

html
<p>Text with stroke</p>
<input type="color" value="#ff0000" />

CSS

css
p {
  margin: 0;
  font-size: 4em;
  -webkit-text-stroke-width: 3px;
  -webkit-text-stroke-color: red; /* Can be changed in the live sample */
}

結果

規範

規範
相容性
# the-webkit-text-stroke-color

瀏覽器相容性

另見