Top 5 CSS selectors

1. Tag selector

Directly use html tags as selectors, which can be html tags such as p div strong

2. id selector

Set the id attribute for a tag, you can use #id{} to set the attribute in css

Third, the class selector

Set the class attribute class="cName" to a tag. You can use .cName{} in css to set the style of this tag

The group selector

Multiple tags can use the same style sheet, which can be combined by the above three

5. Descendant selector

p strong{} indicates that this style will be applied to the strong under the p tag


Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324649685&siteId=291194637