前端学习经验(8)
CSS
结构伪类选择器
type系列:
first-of-type:选择同类型的标签或选择器中第一个元素。
父元素>标签或选择器:first-of-type{
样式表
}
如:
<head>
<style>
.a>div:first-of-type{
font-family: "楷体";
font-size: 30px;
color: aqua;
}
.a>.aa:first-of-type{
font-family: "黑体";
font-size: 50px;
color: green;
}
</style>
</head>
<body>
<div class="a">
<h3>子元素1</h3>
<div>子元素2</div>
<p>子元素3</p>
<span class="aa">子元素4</span>
<h3>子元素5</h3>