Skip to content

Latest commit

 

History

History
27 lines (22 loc) · 329 Bytes

selector_11.md

File metadata and controls

27 lines (22 loc) · 329 Bytes

伪类选择器:E:nth-last-of-type(n)

匹配同类型中的倒数第n个同级兄弟元素E

例:

<!DOCTYPE html>
<html>
<head>
<style>
p:nth-last-of-type(2)
{
background:#35b558;
}
</style>
</head>
<body>

<h1>标题-极客学院</h1>
<p>第一行</p>
<p>第二行</p>
<p>第三行</p>

</body>
</html>