CSS3中only-child伪类选择器
来源:互联网 发布:淘宝卖家手续费 编辑:程序博客网 时间:2024/06/12 20:38
<body>
<style type="text/css">
//只对li1设置样式
li:nth-child(1):nth-last-child(1){
background:yellow;
}
</style>
<h2>列表1</h2>
<ul>
<li>li1</li>
</ul>
<h2>列表2</h2>
<ul>
<li>li1</li>
<li>li2</li>
</ul>
</body>
另外:可以直接使用
li:only-child{
background:yellow;
}
来达到相同的目的。
0 0
- CSS3中only-child伪类选择器
- 【CSS3】only-child选择器
- CSS3伪类选择器:nth-child()
- CSS3伪类选择器:nth-child()
- CSS3 :nth-child()伪类选择器
- CSS3伪类选择器:nth-child()
- CSS3 :nth-child()伪类选择器
- CSS3 :nth-child()伪类选择器
- CSS3 伪类选择器 nth-child()说明
- CSS3 :nth-child()伪类选择器
- CSS3 :nth-child()伪类选择器
- CSS3伪类选择器:nth-child()
- web CSS3伪类选择器 :nth-child()
- CSS3:nth-child()伪类选择器…
- CSS3 :nth-child()伪类选择器
- css3:nth-child()伪类选择器
- 【CSS3】---结构性伪类选择器-first-child+last-child
- CSS3中:only-child选择器的实例场景
- 如何将word文档转换成电子书?
- CSS3中结构伪类选择器——root、not、empty、target选择器
- CSS3中first-child、last-child、nth-child、nth-last-child
- java笔记-接口
- CSS3中nth-of-type和nth-last-of-type
- CSS3中only-child伪类选择器
- CSS3使用content属性来插入项目编号
- CSS3让文本自动换行——word-break属性
- CSS3让长单词与URL地址自动换行——word-wrap属性
- CSS3对于盒中容纳不下的内容的显示——overflow属性
- Webservice
- Merge Two Sorted Lists-满满的套路
- 操作系统的简介
- Ext scope学习