Home >Web Front-end >CSS Tutorial >The first summary of common css attributes: id and class selectors
Speaking of selectors, everyone is familiar with them. It is estimated that the most commonly used ones are the id selector and the class selector. As for other selectors, I will avoid talking about them here today.
Class selector: Give the html element a loud name and mark it with class, then you can use the class selector, such as It is paragraph 1
to "p1", and then write the css style to use it directly,
For example:
p.p1{color:red;}
This paragraph will also be center-aligned.