1、基础样式更改
* {
margin: 0;
padding: 0;
}
ul,
li {
list-style: none;
}
input,
textarea {
border: none;
resize: none;
outline: none;
}
2、文本多余部分,省略号显示
// 一行
.ellipsis {
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
word-break: break-all;
}
// 两行
.ellipsis-two {
text-overflow: -o-ellipsis-lastline;
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 2;
line-clamp: 2;
-webkit-box-orient: vertical;
}
3、清除浮动
.clear-fix{
&:before {
content: "";
display: table;
}
&:after{
clear: both;
visibility: hidden;
font-size: 0;
height: 0;
content: "";
display: table;
}
}
4、浏览器默认字体最小为12px,若想设置9px,可用缩放解决
.font-9 {
font-size: 12px;
-webkit-transform-origin-x: 0;
-webkit-transform: scale(0.75);
transform: scale(0.75);
}