选择器匹配作为任何元素的第一个子元素

2024-01-18 14:31 小编

匹配第一个 <p> 元素

在下面的例子中,选择器作为任何元素的第一个子元素的 p 元素:

<html>
<head>
<style type="text/css">
p:first-child {
  color: red;
  } 
</style>
</head>

<body>
<p>some text</p>
<p>some text</p>
</body>
</html>


在线咨询 拨打电话

电话

13363039260

内部绝密传真282期

微信二维码