aboutsummaryrefslogtreecommitdiff
path: root/files/zh-cn/web/css/initial_value/index.html
blob: 7b74d8ccc33a3daff7f49f275c2b3bba28518ded (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
---
title: 初始值
slug: Web/CSS/initial_value
tags:
  - CSS
  - Reference
translation_of: Web/CSS/initial_value
---
<div>{{cssref}}</div>

<p><a href="/zh-CN/docs/Web/CSS">CSS</a>属性的<strong>初始值</strong>是其默认值,如其定义表中所列。 初始值的使用取决于属性是否被继承:</p>

<ul>
 <li>对于<a href="/en-US/docs/CSS/inheritance#Inherited_properties" title="en/CSS/inheritance#Inherited_properties">继承属性</a>,初始值只能被用于没有指定值的<strong>根元素</strong>上。</li>
 <li>对于<a href="/en-US/docs/CSS/inheritance#Non-inherited_properties" title="en/CSS/inheritance#Non-inherited_properties">非继承属性</a>,初始值可以被用于<strong>任意</strong>没有指定值的元素上。</li>
</ul>

<div class="note">
<p><strong>注意:</strong>你可以使用 <code><a href="/en-US/docs/CSS/initial" title="en/CSS/initial">initial</a></code> 关键词明确指定初始值。</p>
</div>

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

<table class="standard-table">
 <thead>
  <tr>
   <th scope="col">Specification</th>
   <th scope="col">Status</th>
   <th scope="col">Comment</th>
  </tr>
 </thead>
 <tbody>
  <tr>
   <td><a href="https://drafts.csswg.org/css-cascade-4/#initial-values">CSS Cascade 4</a></td>
   <td></td>
   <td>Formal definition.</td>
  </tr>
  <tr>
   <td>{{SpecName("CSS2.1", "cascade.html#specified-value", "initial value")}}</td>
   <td>{{Spec2("CSS2.1")}}</td>
   <td>Implicit definition.</td>
  </tr>
 </tbody>
</table>

<h2 id="参见">参见</h2>

<ul>
 <li>{{cssxref("initial")}}</li>
 <li>{{CSS_key_concepts}}</li>
</ul>