Learning CSS from 0 at the age of 33_runoob.com_4

P
id/class selector
id # Single control
class. Multiple controls

D
<!DOCTYPE html>
<html>
<head>
<style>
#helloId {
color:red;
text-align:center;
}
p.helloClass {
color: blue;
text-align:center;
}
</style>
</head>
<body>
<p id="helloId">hello selector css id<p>
<p class="helloClass">hello selector css class</p >
</body>
</html>

C
1/Try the id and class selectors
2/Use the p element at the same time, both the id and the class have customized the p style, and found that the id has a higher priority than the class

A
continue learning

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326937381&siteId=291194637