<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<style>
p{
color: green;
font-size: 20px;
}
#p1{
color: red;
}
.p2{
color: aqua;
}
/* ul li:first-child{
background-color: red;
}
ul li:last-child{
background-color:aqua;
}
ul li:nth-child(3){
background-color: blue;
} */
ul li:first-of-type{
background-color: red;
}
ul li:last-of-type{
background-color: blueviolet;
}
ul li:nth-of-type(5){
background-color: green;
}
</style>
</head>
<body>
<h1>望庐山瀑布</h1>
<p>日照香炉生紫烟,</p>
<p>遥看瀑布挂前川。</p>
<p>飞流直下三千尺,</p>
<p> 疑是银河落九天。</p>
<p id="p1" class="p2">你好</p>
<ul>
<p>你好啊</p>
<li>52</li>
<li>95</li>
<li>884</li>
<li>555</li>
<li>58</li>
<li>55</li>
<p>你也好</p>
</ul>
</body>
</html>
css选择器
最新推荐文章于 2025-05-17 20:54:51 发布