all
简写
CSS
property resets all of an element's properties except
unicode-bidi
,
direction
,和
CSS Custom Properties
.
It can set properties to their initial or inherited values, or to the values specified in another stylesheet origin.
The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request.
/* Global values */ all: initial; all: inherit; all: unset; /* CSS Cascading and Inheritance Level 4 */ all: revert;
all
property is specified as one of the CSS global keyword values. Note that none of these values affect the
unicode-bidi
and
direction
特性。
initial
inherit
unset
Specifies that all the element's properties should be changed to their inherited values if they inherit by default, or to their initial values if not.
revert
unset
.
revert
, the Author origin includes the Override and Animation origins.
| 初始值 | There is no practical initial value for it. |
|---|---|
| 适用于 | 所有元素 |
| 继承 | no |
| 计算值 | as the specified value applies to each property this is a shorthand for. |
| 动画类型 |
as each of the properties of the shorthand (all properties but
unicode-bidi
and
direction
)
|
initial | inherit | unset | revert
<blockquote id="quote"> Lorem ipsum dolor sit amet, consectetur adipiscing elit. </blockquote> Phasellus eget velit sagittis.
body {
font-size: small;
background-color: #F0F0F0;
color: blue;
}
blockquote {
background-color: skyblue;
color: red;
}
all
property
<blockquote>
uses the browser's default styling together with a specific background and text color. It also behaves as a
block
element: the text that follows it is beneath it.
all:unset
<blockquote>
doesn't use the browser default styling: it is an
inline
element now (initial value), its
background-color
is
transparent
(initial value), but its
font-size
is still
small
(inherited value) and its
color
is
blue
(inherited value).
all:initial
<blockquote>
doesn't use the browser default styling: it is an
inline
element now (initial value), its
background-color
is
transparent
(initial value), its
font-size
is
normal
(initial value) and its
color
is
black
(initial value).
all:inherit
<blockquote>
doesn't use the browser default styling: it is a
block
element now (inherited value from its containing
<body>
element), its
background-color
is
#F0F0F0
(inherited value), its
font-size
is
small
(inherited value) and its
color
is
blue
(inherited value).
| Desktop | Mobile | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
all
|
Chrome 完整支持 37 | Edge 完整支持 79 | Firefox 完整支持 27 | IE 不支持 No | Opera 完整支持 24 | Safari 完整支持 9.1 | WebView Android 完整支持 37 | Chrome Android 完整支持 37 | Firefox Android 完整支持 27 | Opera Android 完整支持 24 | Safari iOS 完整支持 9.3 | Samsung Internet Android 完整支持 3.0 |
revert
|
Chrome 完整支持 84 | Edge 完整支持 84 | Firefox 完整支持 67 | IE 不支持 No | Opera 完整支持 70 | Safari 完整支持 9.1 | WebView Android 完整支持 84 | Chrome Android 完整支持 84 | Firefox Android 完整支持 67 | Opera Android 不支持 No | Safari iOS 完整支持 9.3 | Samsung Internet Android 不支持 No |
完整支持
不支持
CSS global keyword values:
initial
,
inherit
,
unset
,
revert
all
text-rendering