Properties that can and cannot be inherited in CSS

Source: Internet
Author: User

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.

All elements can be inherited: visibility and cursor. 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. Block elements can inherit: Text-indent and Text-align. List elements can be inherited: List-style, List-style-type, List-style-position, List-style-image. Table elements can be inherited: Border-collapse.

Conversely, inheritable is the parent node setting this property, the child node can inherit his properties,

Here to understand what is a block element, inline element.
The block element, which is the default value of block for the display of its properties, is div,p,h1 and so on, but does not mean that the tag must be a block element, and when the programmer changes his display property, it is not a block element

Properties that can and cannot be inherited in CSS

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.