Three CSS Advanced Syntax

Source: Internet
Author: User

Selector grouping

Selectors can be grouped, grouped selectors can share the same declaration, and a comma separates the selectors that need to be grouped. For example:

{  color: green;  }

Inheritance and its problems
In general, child elements inherit the attributes of the parent element. But this situation is sometimes not allowed, for example, NETSCAPE4 does not support inheritance. Fortunately, we also have the "be kind to Netscape4" redundancy rule to deal with problems that cannot be inherited.

Body   {     font-family: Verdana, Sans-serif;     } p, TD, UL, OL, Li, DL, DT, DD   {     font-family: Verdana, Sans-serif;     }

This will waste some users ' broadband, but it solves the problem that cannot be inherited.
Get rid of inheritance

If the child element wants to get rid of the inheritance is the same as above, as long as the child element to redefine its rules.

Three CSS Advanced Syntax

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.