一、x:nth-child(n)
example source code : li:nth-child(3) { color: red; } |
二、x:nth-last-child(n)
example source code : li:nth-last-child(2) { color: red; } |
三、x:nth-of-type(n)
example source code: ul:nth-of-type(3) { border: 1px solid black; } |
四、x:nth-last-of-type(n)
example source code : ul:nth-last-of-type(3) { border: 1px solid black; } |
五、x:first-child
example source code: ul li:first-child { border-top: none; } |
六、x:last-child
example source code : ul > li:last-child { color: green; } |
七、x:only-child
example source code: div p:only-child { color: red; } |
八、x:only-of-type
example source code: li:only-of-type { font-weight: bold; } |
九、x:first-of-type
example source code : ul:first-of-type{ font-weight: bold; } |
如对本文有疑问, 点击进行留言回复!!
深入理解CSS background-blend-mode的作用机制
网友评论