CSS选择器中伪类选择器

我自己做了个网页想学习下css选择器,使用.wrapper :first-child查找class为wrapper的第一个子元素,但是搜索得到的元素和预设不太一样

img

可以截全一点代码嘛

first-child 是找自己的第一个,跟名字直译的有点区别
可以上MDN看下官方解释https://developer.mozilla.org/zh-CN/docs/Web/CSS/:first-child
你这个可以

<div>
<h1 class='title2-1'>this is h1.1 tag</h1>
<h1 class='title2-1'>this is h1.2 tag</h1>
</div>
<style>
.title2-1:first-child{
color:red
}
</style>