aboutsummaryrefslogtreecommitdiff
path: root/files/ja/web/css/-webkit-text-stroke/index.md
blob: 1d4d700b96c5eaea044080471240ba404ef2bf53 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
---
title: '-webkit-text-stroke'
slug: Web/CSS/-webkit-text-stroke
tags:
  - CSS
  - CSS プロパティ
  - 標準外
  - リファレンス
  - WebKit
  - recipe:css-shorthand-property
browser-compat: css.properties.-webkit-text-stroke
translation_of: Web/CSS/-webkit-text-stroke
---
{{CSSRef}}{{Non-standard_header}}

**`-webkit-text-stroke`** は [CSS](/ja/docs/Web/CSS) のプロパティで、テキスト文字の輪郭線の[幅](/ja/docs/Web/CSS/length)と[色](/ja/docs/Web/CSS/color_value)を指定します。これは個別指定プロパティ {{cssxref("-webkit-text-stroke-width")}} および {{cssxref("-webkit-text-stroke-color")}} の一括指定プロパティです。

```css
/* 幅と色の値 */
-webkit-text-stroke: 4px navy;
text-stroke: 4px navy;

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

## 構成要素のプロパティ

このプロパティは以下の CSS プロパティの一括指定です。

- [`-webkit-text-stroke-color`](/ja/docs/Web/CSS/-webkit-text-stroke-color)
- [`-webkit-text-stroke-width`](/ja/docs/Web/CSS/-webkit-text-stroke-width)

## 構文

### 値

- {{cssxref("<length>")}}
  - : 輪郭線の幅です。
- {{cssxref("<color>")}}
  - : 輪郭線の色です。

## 公式定義

{{CSSInfo}}

## 形式文法

{{csssyntax}}

## 例

### テキストに赤い輪郭線を追加

#### HTML

```html
<p id="example">このテキストの輪郭線は赤です。</p>
```

#### CSS

```css
#example {
  font-size: 3em;
  margin: 0;
  -webkit-text-stroke: 2px red;
}
```

#### 結果

{{EmbedLiveSample("Adding_a_red_text_stroke", 600, 60)}}

## 仕様書

{{Specifications}}

## ブラウザーの互換性

{{Compat}}

## 関連情報

- [Surfin' Safari blog post announcing this feature](https://www.webkit.org/blog/85/introducing-text-stroke/)
- [CSS-Tricks article explaining this feature](https://css-tricks.com/adding-stroke-to-web-text/)
- {{cssxref("-webkit-text-stroke-width")}}
- {{cssxref("-webkit-text-stroke-color")}}
- {{cssxref("-webkit-text-fill-color")}}