flex垂直水平居中
.flex-wrap {
display: flex;
align-items: center;
justify-content: center;
}
.flex-wrap>.flex-item {
flex: 1;
}
绝对定位居中
.is-Transformed {
margin: auto;
position: absolute;
top: 50%;
left: 50%;
-webkit-transform: translate(-50%, -50%);
-ms-transform: translate(-50%, -50%);
transform: translate(-50%, -50%);
}
清除浮动
.clearfix {
zoom: 1;
}
.clearfix:after {
content: '';
display: block;
clear: both;
}
小三角
.triggle {
width: 0;
height: 0;
border-left: 4px solid transparent;
border-right: 4px solid transparent;
border-bottom: 8px solid #fff;
}
.triggle-black {
width: 0;
height: 0;
border-left: 4px solid transparent;
border-right: 4px solid transparent;
border-top: 8px solid #000;
display: inline-block;
cursor: pointer;
}
.triggle-black.active {
transform: rotate(180deg);
-webkit-transform: rotate(180deg);
}
多行文本省略
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 3;
overflow: hidden;
less+rem适配
@adapterDeviceList:320px,360px,375px,384px,400px,414px,424px,480px,540px,640px,720px,750px;
@len:length(@adapterDeviceList);
@baseFontSize:100px;
@psdWidth:750px;
.adapterMixin(@index:1) when (@index<=@len){
@media (min-width: extract(@adapterDeviceList,@index)) {
html{
font-size: @baseFontSize/@psdWidth*extract(@adapterDeviceList,@index);
}
}
.adapterMixin(@index+1);
}
.adapterMixin();