[CSS] Concise tutorial style sheet writing format

Source: Internet
Author: User
Tags format
css| Tutorials | Style sheets in general, the Declaration of a stylesheet is divided into selectors (selector) and blocks {} (block), which contain attributes (properties) and the value of the property (value), and the basic format is as follows:

Selector {property: value}

Other format 1:

Selector 1, selector 2, selector 3 {Property 1: Value 1; Property 2: Value 2; property 3: Value 3}

Sometimes multiple selectors will use the same settings, in order to simplify the code, we can set the style for them, and add "," between multiple selectors to separate them.

When you have more than one attribute, you must separate the two attributes with ";".

Other Format 2:

Selector 1 Selector 2 {Property 1: Value 1; Property 2: Value 2; property 3: Value 3}

and format 1 are very similar, but only less between the selector ",", but the effect is very different. Represents a style rule that is set when the selection character 2 includes content that is included in the selector 1.



Related Article

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.