1. Mark Selector
Declare which tags use the CSS style. Therefore, the names of each HTML tag can be used as the names of the corresponding tag selector. Example:
Code:
- <Style>
- H1{
- Color:Red;
- Font-size:25px;
- }
- </Style>
2. Category Selector
The name of the class selector can be customized by the user. Example:
Code:
-
-
-
-
"red" .......
-
In the HTML Tag, you can also apply multiple class selectors to a tag at the same time to apply the style of two classes to one tag at the same time.
Code:
- <H4Class ="Blue big"> Two classes, at the same timeBlueAnd big 4>
3. ID Selector
The use of ID and class is basically the same. The difference is that the ID selector can only be used once on the HTML page, so it is more targeted.
Code:
-
-
-
-
-
-
"blod" ID selector
-
-
It is incorrect to use the ID selector for multiple tags because the ID defined by each tag can be called not only by CSS, but also by other scripting languages such as JavaScript. If the getelementbyid () function fails.
Id selector does not support simultaneous use of multiple styles like class selector. Similar to id = "bold Green" is a completely incorrect syntax.