Home >Web Front-end >HTML Tutorial >DIV CSS中ID和CLASS_html/css_WEB-ITnose
Let’s look at a piece of code first:
The id attribute is used. Corresponding to #top{} in CSS
Look at another piece of code:
The class attribute is used. Corresponding to .bottom a{} in CSS
According to the CSS2.0 manual, a is included in the pseudo-class. In the second example, the properties of the hyperlink a are controlled through CSS, and then the area is defined in a div. The class name corresponding to a.
Therefore, pay attention to the difference between id and class. The latter can only be used for calling css pseudo-classes.