省的百度的CSS

218 阅读1分钟

不要标题了

1.inherit
让一个不具备继承特性的属性可以继承父元素的定义
div {
    position: relative
}
div a {
    position: inherit
}
2.pointer-events
取值:auto和none;
.overlay {
    pointer-events: none
} //将捕获不到任何点击,而只是让事件穿透到它的下面
3.  选择器1 + 选择器2 : 相邻选择器。
    选择器1 ~ 选择器2 : 兄弟选择器。

兄弟选择器 相邻选择器 4.E:not(s): 匹配不含有s选择符的元素E.

.demo li:not(:last-child) {
	border-bottom: 1px solid #ddd;
}//除最后一项外的所有列表项加一条底边线
5.  E:first-child {}: 匹配父元素的第一个子元素E
    E:last-child {}: 匹配父元素的最后一个子元素E
ul li:first-child{} 
ul li:last-child{}
```6.文字超出三个点

li{ overflow:hidden; word-break:keep-all; white-space:nowrap; text-overflow:ellipsis; }