css3 - 层次选择器
css3 选择器 层次
2023-09-11 14:14:38 时间
div div {
background: orange;
}
body>div {
background: green;
}
.active+div {
background: lime;
}
.active~div {
background: red;
}
div div :说明div标签与div标签才生效
body>div:说明body下面的div标签全部生效
.active+div:说明active类下面的第一个div生效
.active~div:说明active类下面的所有div都生效
相关文章
- css3 nth-child选择器
- 结合CSS3的布局新特征谈谈常见布局方法
- CSS3中引入多种自定义字体(font-face)
- css3新增属性有哪些?css3中常用的新增属性总结
- css3效果隔两秒旋转然后停两秒再继续旋转,无限循环
- css3-loading效果
- 使用css3伪元素制作时间轴并且实现鼠标选中高亮效果
- [CSS3] Container query
- [CSS3] Use CSS Variables to Maintain the Aspect Ratio for an Element
- [CSS3] Define Form Element States with CSS Form Pseudo Classes
- [CSS3] CSS :target Selector
- [CSS3] @keyfream
- Atitit.隔行换色 变色 css3 结构性伪类选择器
- 【CSS3】CSS3 结构伪类选择器 ( E:first-child / E:last-child 选择器 | E:nth-child(n) 选择器 | E:nth-of-type 选择器 )