记录一下常用的全局css——common.css
body{overflow-x:hidden;}
body,dl,dd,h1,h2,h3,h4,h5,h6,p,form,pre,textarea{margin:0;font-family:"微软雅黑","Microsoft YaHei";font-size:14px;}
a{text-decoration:none; outline:none;}
a:hover{text-decoration:none;}
ol,ul,button{margin:0;padding:0;}
td,th,input{padding:0;}
input,select,textarea,button,iframe{vertical-align:middle;border:none;outline:none;}
input,select,textarea,iframe {background:#FFF;}
input[readonly] {color: #999999;background-color: #eeeeee;}
br{line-height:0;font-size:0;}
li{list-style-type:none;}
img{border:0;}
ul,ol{list-style:none;}
em,i{font-weight:normal;font-style:normal;}
table{border-collapse:collapse;width:100%;}
td,th{word-wrap:break-word;word-break:break-all;overflow:hidden;}
.clear{clear:both;line-height:0px;font-size:0px;overflow:hidden;}
ul li{float: left;}
.fl{float: left;}
.fr{float: right;}
.va{vertical-align:middle;}
.bs{box-sizing:border-box;}
.mar-auto{margin:0 auto;}
.no-mar{margin:0 !important;}
.ellipsis {overflow: hidden;-o-text-overflow: ellipsis;text-overflow: ellipsis;white-space: nowrap;}
.cp {cursor:pointer}
使用方法
以vue的cli框架为例,其他框架也大同小异。
- 在assets的css文件夹下新增common.css文件
- 在项目的main.js下引入该文件即可
import '@/assets/css/common.css';