-webkit-text-stroke
-webkit-text-stroke CSS 屬性指定文字字元描邊的寬度和顏色。這是一個簡寫屬性,對應於-webkit-text-stroke-width 和 -webkit-text-stroke-color 這兩個獨立屬性。
構成屬性
此屬性是以下 CSS 屬性的簡寫:
語法
css
/* Width and color values */
-webkit-text-stroke: 4px navy;
/* Global values */
-webkit-text-stroke: inherit;
-webkit-text-stroke: initial;
-webkit-text-stroke: revert;
-webkit-text-stroke: revert-layer;
-webkit-text-stroke: unset;
值
正式定義
| 初始值 | 作為簡寫中的每個屬性
|
|---|---|
| 應用於 | 所有元素 |
| 繼承性 | 是 |
| 計算值 | 作為簡寫中的每個屬性 |
| 動畫型別 | 作為簡寫中的每個屬性 |
正式語法
-webkit-text-stroke =
<line-width> ||
<color>
<line-width> =
<length [0,∞]> |
thin |
medium |
thick
示例
新增紅色文字描邊
HTML
html
<p id="example">The stroke of this text is red.</p>
CSS
css
#example {
font-size: 3em;
margin: 0;
-webkit-text-stroke: 2px red;
}
結果
規範
| 規範 |
|---|
| 相容性 # -webkit-text-stroke |
瀏覽器相容性
載入中…