css_sduty/06_CSS复合选择器/02_并集选择器.html
2024-06-29 18:53:19 +08:00

45 lines
845 B
HTML

<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>02_并集选择器</title>
<style>
.rich {
color: gold;
}
.beauty {
color: red;
}
#wc {
color: pink;
}
p.beauty {
color: green;
}
.rich,
.beauty,
#wc,
p.beauty {
font-size: 40px;
background-color: gray;
width: 180px;
}
</style>
</head>
<body>
<h2 class="rich">土豪张三</h2>
<h2 class="beauty">明星<span>李四</span></h2>
<h2>破产王五(不加样式)</h2>
<hr>
<p class="beauty" id="wc">小狗旺财</p>
<p class="beauty">小猪佩奇</p>
</body>
</html>