This article mainly introduces how to use css in html. Generally, style control is implemented using class and id. However, jquery can be better controlled and is also a popular js framework. We recommend that you learn it.
1: Tag Selector
The tag selector is effective for all tags with certain labels. Take p as an example, that is, all the styles with p tags will look like this.
The Code is as follows:
P {font: ""; color: # FF0000}
What I'm doing now is the tag selector.
I also use the tag selector.
I have not been modified by any Selector
2: id SelectorNote that the id selector is unique because only id = "yy" has this style, and the Id of the element in a page must be unique... You know that the id selector starts with #. Its usage is: id = ""
The Code is as follows:
# Yy {font: ""; color: # FF0000}
What I'm showing now is the id Selector
I am not modified by the id Selector
I have not been modified by any Selector
3: class selectorThe class selector starts with a. And only the class = "" of the element can be expressed as this style. Its usage is: class = ""
The Code is as follows:
. Yy {font: ""; color: # FF0000}
What I'm showing now is the class selector
I have not been modified by the class selector
I have not been modified by any Selector