-webkit-text-stroke-width

Baseline Widely available

This feature is well established and works across many devices and browser versions. It’s been available across browsers since April 2017.

非標準: この機能は標準ではなく、標準化の予定もありません。公開されているウェブサイトには使用しないでください。ユーザーによっては使用できないことがあります。実装ごとに大きな差があることもあり、将来は振る舞いが変わるかもしれません。

-webkit-text-stroke-widthCSS のプロパティで、テキストの線の太さを指定します。

構文

css
/* キーワード値 */
-webkit-text-stroke-width: thin;
-webkit-text-stroke-width: medium;
-webkit-text-stroke-width: thick;

/* <length> 値 */
-webkit-text-stroke-width: 2px;
-webkit-text-stroke-width: 0.1em;
-webkit-text-stroke-width: 1mm;
-webkit-text-stroke-width: 5pt;

/* グローバル値 */
-webkit-text-stroke-width: inherit;
-webkit-text-stroke-width: initial;
-webkit-text-stroke-width: unset;

<line-width>

線の太さ。

公式定義

初期値0
適用対象すべての要素
継承あり
計算値絶対的な長さ
アニメーションの種類離散値

形式文法

-webkit-text-stroke-width = 
<line-width>

<line-width> =
<length [0,∞]> |
thin |
medium |
thick

線の幅を変更

CSS

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

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

結果

仕様書

Specification
Compatibility
# the-webkit-text-stroke-width

ブラウザーの互換性

Report problems with this compatibility data on GitHub
desktopmobile
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
WebView on iOS
-webkit-text-stroke-width

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support

関連情報