<!-- 伪类学习first-child -->
<!DOCTYPE html>
<html>
<head>
<title>伪类的学习first-child标签</title>
<style type="text/css">
/* p{
font-size: 16px;
color: #000;
}*/
/*p:first-child:修改第一个p标签*/
p:first-child{
color:aqua;
}
/*p>span:first-child每个p标签里的第一个span*/
p>span:first-child{
color: aqua;
}
/*p:first-child span 修改第一个p标签里的所有span*/
p:first-child span{
color: aqua;
}
</style>
</head>
<body>
<p>哈喽 <span>大家好</span>,我是 <span>H</span></p>
<p>哈喽 <span>大家好</span>,我是 <span>H</span></p>
<p>哈喽 <span>大家好</span>,我是 <span>H</span></p>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<title>伪类的学习first-child标签</title>
<style type="text/css">
/* p{
font-size: 16px;
color: #000;
}*/
/*p:first-child:修改第一个p标签*/
p:first-child{
color:aqua;
}
/*p>span:first-child每个p标签里的第一个span*/
p>span:first-child{
color: aqua;
}
/*p:first-child span 修改第一个p标签里的所有span*/
p:first-child span{
color: aqua;
}
</style>
</head>
<body>
<p>哈喽 <span>大家好</span>,我是 <span>H</span></p>
<p>哈喽 <span>大家好</span>,我是 <span>H</span></p>
<p>哈喽 <span>大家好</span>,我是 <span>H</span></p>
</body>
</html>