Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What is the use of the new property all of css3

2025-04-01 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/01 Report--

Editor to share with you what is the use of css3's new attribute all, I believe most people do not know much about it, so share this article for your reference, I hope you can learn a lot after reading this article, let's go to know it!

The all attribute is actually an acronym for all CSS attributes, indicating what all CSS properties should do; however, the unicode-bidi and direction CSS attributes are not included. Therefore, we should be able to know what the all attribute does:

All attribute: all selected element attributes can be reset except for two attributes that control the orientation of the text: the direction attribute and the unicode-bidi attribute.

.demo {

All:unset

}

Its focus is to allow component-level style resets. Sometimes it is much easier to set the desired style from scratch than to modify the original style.

Let's take a look at the property values that can be set by the all property:

1. Initial: resets the attributes of all selected elements to the initial values defined in the CSS specification.

2. The inherit:selected element inherits the styles of all its parent elements, including styles that are usually not inheritable.

3. The unset:selected element inherits any inheritable value passed down from the parent element. If no inheritable values are available, the initial values of the CSS specification are used for each property.

Description:

Some properties in css do not explicitly define initial values in the specification, but allow users to set their own initial values, such as color and font family.

All is an abbreviated property because it allows us to use a single declaration to control the value of each CSS property at a time. However, unlike most abbreviated properties, there is no practical "longhand" version and no child attributes.

Let's take a look at the demonstration of all:

Html Code:

Changethisdiv'sallvalue.

Css Code:

.container {/ * inherit * /

Font-family:sans-serif

Font-size:1.5em

Text-align:center

Text-transform:uppercase

Text-shadow:1px1px1pxblack

}

.parent {

Color:green;/* inheritance * /

/ * do not inherit * /

Background-color:gainsboro

Width:80%

Padding:1em

Border:5pxsolid#E18728

}

The above is all the content of this article entitled "what is the use of all, a new attribute of css3?" thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 271

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report