1、基础样式重置:
html,body,img{
height:100%
}
html,body,ul,li,div,a,p,
img,input,button,
h1,h2,h3,h4,h5
{padding: 0;margin: 0;}
ul{
font-size:0;
padding-inline-start:0;
}
li{
list-style: none;
}
html{
font-size:16px;
}
//原本是打算rem布局宽度,em字体布局; 不过,单纯使用rem也是可以的;
//综合性来说,是需要 rem与px为主; 百分比为辅助,em处理字体,vmin,vmax,vw,vh(兼容性)等;
//flex布局优先,Grid布局其次;
body,li{
font-size:16px;
}
a{
text-decoration: none;
}
a,button{
color: #fff;
}
img{
weight:100%;
}
input,button{
outline: none;
background: none;
border: none;
}
button{
cursor: pointer;
}
2、类样式复用:
//视图
.view{
width: 1200px; //min-weight ~ max-weight
margin: 0 auto;
}
//清除浮动
.cfix{
content: '';
display: table;
height: 0;
width: 0;
clear: both;
}
//Flex布局
.fx{
display: flex;
justify-content: space-between;
align-items: center;
}
//文本排列
.t-center{ text-align: center; }
.t-right{ text-align: right; }
.t-left{ text-align: left; }
//文本溢出(注意:溢出需要在一个宽度的前提下)
//单行溢出
.ellipsis{
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
//多行溢出
3、其他效果处理
//:hover + transition
//鼠标Hover之后的时间过度效果
div:{
transition: all .4s ease;
&:hover{
//somecode...
}
}