不知道对不对,实测了一下,基本选择器的优先级:id选择器>类选择器>元素选择器>通配选择器
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>努力的小新</title>
<style>
* {
color: black;
font-size: 80px;
}
p {
color: green;
font-size: 80px;
}
.xihuan {
color: blue;
font-size: 80px;
}
#xiao {
color: red;
font-size: 80px;
}
</style>
</head>
<body>
<p id="xiao" class="xihuan">小新喜欢风间</p>
<p>小爱喜欢小新</p>
</body>
</html>