3.css初始化样式(开发前)

2020-07-06  本文已影响0人  半生_温暖纯良_Junzer

1.初始样式

div {
border-radius: 5px;
}
img {
 display: block;
}
li {
 list-style-type: none;
}
a {
 display: block;  // 点击全部占据
 color: #096;
 text-decoration: none;
}
/* 清除浮动 */
.clearfix:after {
  /*伪元素是行内元素 正常浏览器清除浮动方法*/
  content: "";
  display: block;
  height: 0;
  clear: both;
  visibility: hidden;
}

.clearfix {
  *zoom: 1;
  /*ie6清除浮动的方式 *号只有IE6-IE7执行,其他浏览器不执行*/
}

.f-left {
  float: left;
}
.f-right {
  float: right;
}

.relative {
position: relative;
}

.flex {
display: flex
}
.flex-col {
display: flex;
flex-direction: column;
}
.flex1 {
flex: 1;
}

2.reset.css

@charset "utf-8";
/* reset */
html,body,h1,h2,h3,h4,h5,h6,div,dl,dt,dd,ul,ol,li,p,blockquote,pre,hr,figure,table,caption,th,td,form,fieldset,legend,input,select,button,textarea,menu{margin:0;padding:0;}
header,footer,section,article,aside,nav,hgroup,address,figure,figcaption,menu,details{display:block;}
table{border-collapse:collapse;border-spacing:0;}
caption,th{text-align:left;font-weight:normal;}
html,body,fieldset,img,iframe,abbr{border:0;}
i,cite,em,var,address,dfn{font-style:normal;}
[hidefocus],summary{outline:0;}
li{list-style:none;}
h1,h2,h3,h4,h5,h6,small{font-size:100%;}
sup,sub{font-size:40%;}
pre,code,kbd,samp{font-family:inherit;}
q:before,q:after{content:none;}
textarea{overflow:auto;resize:none;}
label,summary{cursor:default;}
a,button{cursor:pointer;}
h1,h2,h3,h4,h5,h6,em,strong,b{font-weight:bold;}
del,ins,u,s,a,a:hover{text-decoration:none;}
body,textarea,input,button,select,keygen,legend{font:14px/1.8 "Microsoft YaHei UI","Microsoft YaHei",Arial,SimSun,"Segoe UI",Tahoma,Helvetica,sans-serif;outline:0;}
body{background:#fff;color:#555;}
上一篇 下一篇

猜你喜欢

热点阅读