aboutsummaryrefslogtreecommitdiff
path: root/files/zh-cn/web/css/css_backgrounds_and_borders/index.html
blob: 0a43587fc3deaf23a61d69885f0eaae3f921c96e (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
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
---
title: CSS Backgrounds and Borders
slug: Web/CSS/CSS_Backgrounds_and_Borders
tags:
  - CSS
  - CSS Backgrounds and Borders
  - NeedsTranslation
  - Overview
  - Reference
translation_of: Web/CSS/CSS_Backgrounds_and_Borders
---
<div>{{CSSRef}}</div>

<p><strong>CSS Backgrounds and Borders</strong> 是CSS的一个模块,它可以让你为元素的背景和边框设置样式。背景可以用颜色或图像填充,剪裁或调整大小,以及以其他方式修改。边框可以用线条或图像装饰,并制成方形或圆形。此外,元素框可以用阴影装饰。</p>

<h2 id="Reference">Reference</h2>

<h3 id="CSS_属性">CSS 属性</h3>

<div class="index">
<ul>
 <li>{{cssxref("background")}}</li>
 <li>{{cssxref("background-attachment")}}</li>
 <li>{{cssxref("background-clip")}}</li>
 <li>{{cssxref("background-color")}}</li>
 <li>{{cssxref("background-image")}}</li>
 <li>{{cssxref("background-origin")}}</li>
 <li>{{cssxref("background-position")}}</li>
 <li>{{cssxref("background-position-x")}}</li>
 <li>{{cssxref("background-position-y")}}</li>
 <li>{{cssxref("background-repeat")}}</li>
 <li>{{cssxref("background-size")}}</li>
 <li>{{cssxref("border")}}</li>
 <li>{{cssxref("border-bottom")}}</li>
 <li>{{cssxref("border-bottom-color")}}</li>
 <li>{{cssxref("border-bottom-left-radius")}}</li>
 <li>{{cssxref("border-bottom-right-radius")}}</li>
 <li>{{cssxref("border-bottom-style")}}</li>
 <li>{{cssxref("border-bottom-width")}}</li>
 <li>{{cssxref("border-collapse")}}</li>
 <li>{{cssxref("border-color")}}</li>
 <li>{{cssxref("border-image")}}</li>
 <li>{{cssxref("border-image-outset")}}</li>
 <li>{{cssxref("border-image-repeat")}}</li>
 <li>{{cssxref("border-image-slice")}}</li>
 <li>{{cssxref("border-image-source")}}</li>
 <li>{{cssxref("border-image-width")}}</li>
 <li>{{cssxref("border-left")}}</li>
 <li>{{cssxref("border-left-color")}}</li>
 <li>{{cssxref("border-left-style")}}</li>
 <li>{{cssxref("border-left-width")}}</li>
 <li>{{cssxref("border-radius")}}</li>
 <li>{{cssxref("border-right")}}</li>
 <li>{{cssxref("border-right-color")}}</li>
 <li>{{cssxref("border-right-style")}}</li>
 <li>{{cssxref("border-right-width")}}</li>
 <li>{{cssxref("border-style")}}</li>
 <li>{{cssxref("border-top")}}</li>
 <li>{{cssxref("border-top-color")}}</li>
 <li>{{cssxref("border-top-left-radius")}}</li>
 <li>{{cssxref("border-top-right-radius")}}</li>
 <li>{{cssxref("border-top-style")}}</li>
 <li>{{cssxref("border-top-width")}}</li>
 <li>{{cssxref("border-width")}}</li>
 <li>{{cssxref("box-shadow")}}</li>
</ul>
</div>

<h2 id="指南">指南</h2>

<h2 id="工具">工具</h2>

<dl>
 <dt><a href="/en-US/docs/Web/CSS/CSS_Backgrounds_and_Borders/Using_multiple_backgrounds">Using multiple backgrounds</a></dt>
 <dd>Explains how to set one or more backgrounds on an element.</dd>
 <dt><a href="/en-US/docs/Web/CSS/CSS_Backgrounds_and_Borders/Scaling_background_images">Scaling background images</a></dt>
 <dd>Describes how to change the size and repeating behavior of background images.</dd>
 <dt><a href="/en-US/docs/Web/HTML/Applying_color">Applying color to HTML elements using CSS</a></dt>
 <dd>An overview of how CSS color can be used in HTML, including for borders.</dd>
 <dt><a href="/zh-CN/docs/Web/CSS/CSS_Background_and_Borders/Border-image_generator">Border-image 生成器</a></dt>
 <dd>此交互式工具让你以可视化方式创建边框图像({{cssxref("border-image")}} 属性)。</dd>
 <dt><a href="/zh-CN/docs/Web/CSS/CSS_Background_and_Borders/Border-radius_generator">Border-radius 生成器</a></dt>
 <dd>此交互式工具让你以可视化方式创建圆角({{cssxref("border-radius")}} 属性)。</dd>
 <dt><a href="/zh-CN/docs/Web/CSS/CSS_Box_Model/Box-shadow_generator">Box-shadow 生成器</a></dt>
 <dd>此交互式工具让你以可视化方式创建元素身后的阴影({{cssxref("box-shadow")}} 属性)。</dd>
</dl>

<h2 id="规范">规范</h2>

<table class="standard-table">
 <thead>
  <tr>
   <th scope="col">规范</th>
   <th scope="col">状态</th>
   <th scope="col">备注</th>
  </tr>
 </thead>
 <tbody>
  <tr>
   <td>{{ SpecName('CSS3 Backgrounds') }}</td>
   <td>{{ Spec2('CSS3 Backgrounds') }}</td>
   <td> </td>
  </tr>
  <tr>
   <td>{{SpecName('CSS2.1', 'box.html')}}</td>
   <td>{{Spec2('CSS2.1')}}</td>
   <td> </td>
  </tr>
  <tr>
   <td>{{SpecName('CSS1', '#border')}}</td>
   <td>{{Spec2('CSS1')}}</td>
   <td> </td>
  </tr>
 </tbody>
</table>

<h2 id="浏览器兼容性">浏览器兼容性</h2>

<p>{{CompatibilityTable}}</p>

<div id="compat-desktop">
<table class="compat-table">
 <tbody>
  <tr>
   <th>Feature</th>
   <th>Chrome</th>
   <th>Firefox (Gecko)</th>
   <th>Internet Explorer</th>
   <th>Opera</th>
   <th>Safari</th>
  </tr>
  <tr>
   <td>Basic support</td>
   <td>1.0</td>
   <td>{{CompatGeckoDesktop("1.0")}}</td>
   <td>4.0</td>
   <td>3.5</td>
   <td>1.0 (85)</td>
  </tr>
 </tbody>
</table>
</div>

<div id="compat-mobile">
<table class="compat-table">
 <tbody>
  <tr>
   <th>Feature</th>
   <th>Android</th>
   <th>Firefox Mobile (Gecko)</th>
   <th>IE Phone</th>
   <th>Opera Mobile</th>
   <th>Safari Mobile</th>
  </tr>
  <tr>
   <td>Basic support</td>
   <td>{{CompatVersionUnknown}}</td>
   <td>{{CompatGeckoMobile("1.9.2")}}</td>
   <td>{{CompatVersionUnknown}}</td>
   <td>{{CompatVersionUnknown}}</td>
   <td>1.0</td>
  </tr>
 </tbody>
</table>
</div>