公共css文件初始化

本文介绍了一种兼容多种浏览器的CSS初始化样式方法,通过统一元素的默认样式来确保跨浏览器的一致性表现。该样式表包括了常用HTML元素的默认样式重置,如边距、填充等,并对字体大小、颜色进行了规范。
body,
html{
  height: 100%;
}
body,
div,
dl,
dt,
dd,
ul,
ol,
li,
h1,
h2,
h3,
h4,
h5,
h6,
pre,
code,
form,
fieldset,
legend,
input,
button,
textarea,
p,
blockquote,
th,
td {
  margin:0;
  padding:0;
  box-sizing: border-box;
}

body, button, input, select, textarea {
  font: 14px Arial,PingFangSC,"Lucida Grande",Verdana,"Microsoft YaHei",hei;
  color: #333;
  line-height: 1.5;
  border: 0;
  outline: 0;
}
h1, h2, h3, h4, h5, h6 {
  font-weight:normal;
  font-size:100%;
}
address, caption, cite, code, dfn, em, strong, th, var {
  font-style:normal;
  font-weight:normal;
}
a { color:#555;
  text-decoration:none;
  font-size: 0.42857142857142855rem;
  font-size: 24/56rem;
}
a:hover {
  text-decoration:none;
}
img { border:none; }
ol,ul,li {
  list-style:none;
  padding: 0;
}
input, textarea, select, button {
  font:0.42857142857142855rem Verdana,Helvetica,Arial,sans-serif;
}
table {
  border-collapse:collapse;
}
.clearfix:after {
  content: ".";
  display: block;
  height:0;
  clear:both;
  visibility: hidden;
}
.clearfix {
  *zoom:1;
}

/*定义滚动条高宽及背景 高宽分别对应横竖滚动条的尺寸*/
::-webkit-scrollbar
{
  width: 0px;
  height: 0px;
  background-color: #F5F5F5;
}
/*定义滚动条轨道 内阴影+圆角*/
::-webkit-scrollbar-track
{
  -webkit-box-shadow: inset 0 0 1px rgba(0,0,0,0);
  border-radius: 10px;
  background-color: #F5F5F5;
}

/*定义滑块 内阴影+圆角*/
::-webkit-scrollbar-thumb
{
  border-radius: 10px;
  -webkit-box-shadow: inset 0 0 6px rgba(0,0,0,.3);
  background-color: #555;
}

input[type="button"], input[type="submit"], input[type="search"], input[type="reset"] {
  -webkit-appearance: none;
}
textarea { -webkit-appearance: none;}
.margin{
  margin: 0 auto;
}
.left{
  float: left;
}
.right{
  float: right;
}
.hide{
  display: none;
}
.show{
  display: block;
}
.ellipsis{
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

兼容多浏览器的 初始化 css 样式

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值