What is the syntax of the CSS class selector
This article mainly introduces "what is the syntax of CSS class selector". In daily operation, I believe many people have doubts about the syntax of CSS class selector. Xiaobian consulted all kinds of materials and sorted out simple and easy-to-use operation methods. I hope it will be helpful to answer the doubt of "what is the syntax of CSS class selector?" Next, please follow the editor to study!
Class selectors are most commonly used in css-style coding, such as the code in the code editor on the right: it can be implemented as "timid" and the "courage" font is set to red.
Syntax:
. Sorter name {css style code;}
Note:
1. The beginning of English dot
2. The name of the selector can be named freely (but not in Chinese)
How to use it:
Step 1: tag the content to be embellished with the appropriate tag, as follows:
As timid as a hare
Step 2: use class= "Class Selector name" to set a class for the tag, as follows:
As timid as a hare
Step 3: set the css style of the selector as follows:
Add an English dot before the .stress {color:red;} / * class * /
What are the selectors of css? css selectors can be divided into three categories, namely, id selector, class selector and tag selector. There can be many combinations between them, such as descendant selector, sub-selector, pseudo-class selector, general selector, group selector, and so on.
At this point, the study of "what is the syntax of the CSS class selector" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!