CSS series: CSS Inheritance and cascading features

Source: Internet
Author: User

1. CSS Inheritance Features

All CSS statements are based on the direct inheritance of the individual tags, CSS inheritance refers to the child tag inherits all the style of the parent tag, and can then be modified on the basis of the style of the parent markup style, resulting in a new style, and the style of the child tag does not affect the parent tag at all.

CSS inherits throughout the entire CSS design, and each tag follows the concept of CSS inheritance.

Example:

<!DOCTYPE HTML><HTML><Head>    <title></title>    <styletype= "Text/css">H1{Color:Blue;text-decoration:Underline;        }em{Color:Red;        }    </style></Head><Body>    <H1>CSS Inheritance<em>Characteristics</em></H1></Body></HTML>

CSS Effects:

2. CSS cascading features

The cascading nature of CSS can be easily understood as a "conflict" solution.

CSS precedence rules: Inline style > ID style > Category style > Marker style.

CSS series: CSS Inheritance and cascading features

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.