CSS3 Book notes 2015/12/6

Source: Internet
Author: User

Chapter fourth saving time with style inheritance

I. The role of inheritance: simplifying style sheets

Ii. commonly used attributes that can be inherited and cannot be inherited

(1) Non-inheritable: display, margin, border, padding, background, height, min-height, max-height, Width, min-width, max-width, Overflow, position, left, right, top, bottom, z-index, float, clear, table-layout, Vertical-align, Page-break-after, Page-bread-before and Unicode-bidi.

(2) All elements can be inherited: visibility and cursor.

(3) Inline elements can be inherited: Letter-spacing, Word-spacing, White-space, line-height, color, font, font-family, Font-size, Font-style, Font-variant, Font-weight, Text-decoration, Text-transform, direction.

(4) terminal block elements can be inherited: Text-indent and Text-align.

(5) List elements can be inherited: List-style, List-style-type, List-style-position, List-style-image.

(6) The table element can inherit: Border-collapse.

The fifth chapter uses the Cascade management style

One, when the inherited attribute conflicts

(1) The most recent ancestor style wins

(2) style attributes that are specifically applied to labels prevail over all inherited properties

If the a tag uses their own preset style, does not inherit from the parent element inherits from the style

(3) Use weights to determine that style wins

Tag Selector 1 points

Class selector 10 min

ID selector 100 points

Built-in style 1000 points

(4) The right value is the same as the last style wins

Second, control cascade

(1)!important

(2) Change the weight value

For example:

. Intro weight value is 10

#sidebar p weight value is 101

#sidebar. Intro weight value is 110

(3) Selective coverage

CSS3 Book notes 2015/12/6

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.