CSS Selector--General Selector

Source: Internet
Author: User

General Selector :

1. Tag Selector: Using the tag Selector, all the same tags will be selected. (For example: Select Div all div is selected.) )

2. Class selector: If an element has multiple class selector styles set, these class selectors will be set. However, if the style in the class selector is set to repeat, it is set according to the nearest principle. "The general selector is the most commonly used selector"

(such as: <div class= "one" >

. one{

color:red;

Background:blue;

}

. both {

Color:yellow;

} color has been set, so take the nearest principle to choose yellow, but the background is not set, choose Blue. )

3.id selector: (identity) Unique identifier, ensuring uniqueness. But only letters, numbers, underscores, and can only start with a letter, cannot be named after the tag name. "Normal selector is the least used selector"

Priority: ID Selector > class selector > tag Selector.

CSS Selector--General Selector

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.