CSS selector

8. CSS selector

8.1. Tag selector
Function: Set the style for a certain tag specified on the page.
Code:

Disadvantage: Only a certain type of label can be styled.
css selector
8.2, class (class) selector
Function: Set the style for a certain label of the specified class name. Each label can be set with a class attribute. The attribute value following the class is called the class name.
Code:

css selector
8.3. id selector
Function: Set the style for the tag with the specified id name. Each tag can be set with an id attribute, and the attribute value after id is the id name.
Code:

css selector
**8.4. Points to note about class name and id name***
class name: equivalent to a small name of the label (can be repeated);
id name: equivalent to the certificate number of the label (not allowed to be repeated);

? One class name can be used for multiple tags, and one id name can only be used for one tag.

? The specification of class name and id name: it can only be composed of English letters, numbers, underscores and hyphens (-), and numbers cannot start, and underscores and hyphens cannot start either (can be used, but not Suggest).
8.5. Wildcard selector
Function: Used to set styles for all tags on the page, often used for page style initialization operations.
Code:

Note: When the wildcard selector is set, it will traverse all the tags on the page and set the styles for these tags.
Disadvantages: performance is too low, mainly used for initializing styles.
css selector

 CSS selectorComprehensive exercise: Baidu homepage

WordPress database error: [Table 'yf99682.wp_s6mz6tyggq_comments' doesn't exist]
SELECT SQL_CALC_FOUND_ROWS wp_s6mz6tyggq_comments.comment_ID FROM wp_s6mz6tyggq_comments WHERE ( comment_approved = '1' ) AND comment_post_ID = 5694 ORDER BY wp_s6mz6tyggq_comments.comment_date_gmt ASC, wp_s6mz6tyggq_comments.comment_ID ASC

Leave a Comment

Your email address will not be published.