From 33058f2b292b3a581333bdfb21b8f671898c5060 Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Tue, 8 Dec 2020 14:40:17 -0500 Subject: initial commit --- files/zh-cn/web/css/initial/index.html | 78 ++++++++++++++++++++++++++++++++++ 1 file changed, 78 insertions(+) create mode 100644 files/zh-cn/web/css/initial/index.html (limited to 'files/zh-cn/web/css/initial') diff --git a/files/zh-cn/web/css/initial/index.html b/files/zh-cn/web/css/initial/index.html new file mode 100644 index 0000000000..3b0bccee3e --- /dev/null +++ b/files/zh-cn/web/css/initial/index.html @@ -0,0 +1,78 @@ +--- +title: initial +slug: Web/CSS/initial +tags: + - CSS + - CSS Value + - Default state + - initial +translation_of: Web/CSS/initial +--- +
{{CSSRef}}
+ +

initial CSS关键字将属性的初始(或默认)值应用于元素。不应将初始值与浏览器样式表指定的值混淆。它可以应用于任何CSS属性。这包括CSS简写{{cssxref("all")}}initial 可用于将所有CSS属性恢复到其初始状态。

+ +
+

注意:在继承的属性上,初始值可能是意外的。你应该考虑使用 {{cssxref("inherit")}}, {{cssxref("unset")}},或{{cssxref("revert")}} 关键字代替。

+
+ +

示例

+ +

HTML

+ +
<p>
+  <span>This text is red.</span>
+  <em>This text is in the initial color (typically black).</em>
+  <span>This is red again.</span>
+</p>
+ +

CSS

+ +
p {
+  color: red;
+}
+
+em {
+  color: initial;
+}
+ +

{{EmbedLiveSample('示例')}}

+ +

Specifications

+ + + + + + + + + + + + + + + + + + + + + +
SpecificationStatusComment
{{ SpecName('CSS4 Cascade', '#initial', 'initial') }}{{Spec2('CSS4 Cascade')}}No changes from Level 3.
{{ SpecName('CSS3 Cascade', '#initial', 'initial') }}{{Spec2('CSS3 Cascade')}}Initial definition.
+ +

浏览器兼容性

+ +
{{Compat("css.types.global_keywords.initial")}}
+ +

 

+ +

参见

+ + -- cgit v1.2.3-54-g00ecf