css 重置样式

/*一个通用的重置样式css,用的标签重置,用不到的不用写,搜索多余的标签会影响页面加载效率*/
/*在页面中引入的时候,重置样式要放在其它样式上方*/

/* 将标签默认的间距设为0*/
body,p,h1,h2,h3,h4,h5,h6,ul,dl,dt,form,input{
    margin:0;
    padding:0;
}

/*去掉ul默认的小圆点*/
ul{list-style:none;}

/*去掉a标签默认的下划线*/
a{text-decoration:none;}

/*去掉em默认的字体倾斜*/
em{font-style:normal;}

/*img在ie下加上连接的话,会出现一个边框,去掉它*/
img{border:0px;}

让h标签继承body中的font-size的设置
h1,h2,h3,h4,h5,h6{font-size:100%}


/*清除浮动和解决margin-top塌陷的公共类*/
.clearfix:before,.clearfix:after{
    content:"";
    display:table;
}

.clearfix:after{clear:both;}

.clearfix{zoom:1;}

/*定义左浮动的类*/
.fl{float:left;}

/*定义右浮动的类*/
.fr{float:right;}

 

posted @ 2019-02-28 01:02  greenfan  阅读(290)  评论(0)    收藏  举报