1、基础样式重置:

  1. html,body,img{
  2. height:100%
  3. }
  4. html,body,ul,li,div,a,p,
  5. img,input,button,
  6. h1,h2,h3,h4,h5
  7. {padding: 0;margin: 0;}
  8. ul{
  9. font-size:0;
  10. padding-inline-start:0;
  11. }
  12. li{
  13. list-style: none;
  14. }
  15. html{
  16. font-size:16px;
  17. }
  18. //原本是打算rem布局宽度,em字体布局; 不过,单纯使用rem也是可以的;
  19. //综合性来说,是需要 rem与px为主; 百分比为辅助,em处理字体,vmin,vmax,vw,vh(兼容性)等;
  20. //flex布局优先,Grid布局其次;
  21. body,li{
  22. font-size:16px;
  23. }
  24. a{
  25. text-decoration: none;
  26. }
  27. a,button{
  28. color: #fff;
  29. }
  30. img{
  31. weight:100%;
  32. }
  33. input,button{
  34. outline: none;
  35. background: none;
  36. border: none;
  37. }
  38. button{
  39. cursor: pointer;
  40. }

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...
  }
}