首页 > 编程学习 > 详解: 8,连续和不连续最后与开始的选择器

核心:我不说之前说过的话,+nth代表从1开始,是奇数还是偶数哈

```css
<!DOCTYPE html>
<html lang="en">
<head><meta charset="UTF-8"><title>Document</title><style type="text/css">.test1 p:first-of-type{color: red;}.test1 p:nth-of-type(1){color: blue;}.test1 p:last-of-type{color: yellow;}.test1 p:nth-last-of-type(1){font-size: 10px;}</style>
</head>
<body><div class="test1"><h1>1111</h1><h2>333</h2><p>444</p><p>555</p><h3>66666</h3><h3>777770</h3><p>8888</p><h3>6666</h3></div>7
</body>
</html>


本文链接:https://www.ngui.cc/el/2926763.html
Copyright © 2010-2022 ngui.cc 版权所有 |关于我们| 联系方式| 豫B2-20100000