1、文本溢出处理
//单行
.single {
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
//多行
.more {
display: -webkit-box !important;
overflow: hidden;
text-overflow: ellipsis;
work-break: break-all;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2; //指定行数
}
2、使用 :not() 来精简css代码
// 不使用:not()
.nav li {
border-right: 1px solid #666;
}
.nav li:last-child {
border-right: none;
}
// 使用:not()
.nav li:not(:last-child) {
border-right: 1px solid #666;
}