-
Notifications
You must be signed in to change notification settings - Fork 8k
/
index.md
198 lines (151 loc) · 2.73 KB
/
index.md
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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
---
title: outline-style
slug: Web/CSS/outline-style
---
{{CSSRef}}
## 概要
**`outline-style`** CSS 属性被用于设置一个元素轮廓的样式。
元素轮廓是绘制于元素周围的一条线,位于{{cssxref("border")}}的外围,使元素突出
大多时候使用{{cssxref("outline")}}而不是 `outline-style`, `outline-width` 和 `outline-color` 会更方便。
{{cssinfo}}
## 语法
```css
/* 关键字 值 */
outline-style: auto;
outline-style: none;
outline-style: dotted;
outline-style: dashed;
outline-style: solid;
outline-style: double;
outline-style: groove;
outline-style: ridge;
outline-style: inset;
outline-style: outset;
/* 全局 值*/
outline-style: inherit;
outline-style: initial;
outline-style: unset;
```
## 取值
`<br-style>` 可为以下这些值:
- none
- : 无轮廓 ({{Cssxref("outline-width")}} 为 `0`).
- dotted
- : 轮廓为一系列点。
- dashed
- : 轮廓为一系列短线。
- solid
- : 轮廓为实线。
- double
- : 轮廓为两根有空隙的线。{{Cssxref("outline-width")}} 为线与空间的总和。
- groove
- : 轮廓呈凹下状。
- ridge
- : 与 `groove` 相反:轮廓呈凸起状。
- inset
- : 轮廓呈嵌入状。
- outset
- : 与 `inset` 相反:轮廓呈突出状。
### 正式语法
{{csssyntax}}
## 示例
### `dotted` 和 `dashed`
#### HTML
```html
<div>
<div class="dotted">
<p class="dashed">Outline Demo</p>
</div>
</div>
```
#### CSS
```css
.dotted {
outline-style: dotted; /* 于 "outline: dotted"等价 */
}
.dashed {
outline-style: dashed;
}
/* 让效果更清楚 */
* {
outline-width: 10px;
padding: 15px;
}
```
{{ EmbedLiveSample('dotted 和 dashed') }}
### `solid` 和 `double`
#### HTML
```html
<div>
<div class="solid">
<p class="double">Outline Demo</p>
</div>
</div>
```
#### CSS
```css
.solid {
outline-style: solid;
}
.double {
outline-style: double;
}
/* 让效果更清楚 */
* {
outline-width: 10px;
padding: 15px;
}
```
{{ EmbedLiveSample('solid 和 double') }}
### `groove` 和 `ridge`
#### HTML
```html
<div>
<div class="groove">
<p class="ridge">Outline Demo</p>
</div>
</div>
```
#### CSS
```css
.groove {
outline-style: groove;
}
.ridge {
outline-style: ridge;
}
/* 让效果更清楚 */
* {
outline-width: 10px;
padding: 15px;
}
```
{{ EmbedLiveSample('groove 和 ridge') }}
### `inset` 和 `outset`
#### HTML
```html
<div>
<div class="inset">
<p class="outset">Outline Demo</p>
</div>
</div>
```
#### CSS
```css
.inset {
outline-style: inset;
}
.outset {
outline-style: outset;
}
/* 让效果更清楚 */
* {
outline-width: 10px;
padding: 15px;
}
```
{{ EmbedLiveSample('inset 和 outset') }}
## 规范
{{Specifications}}
## 浏览器兼容性
{{Compat}}