常用全局定义和清除浮动

全局定义

body { margin:0 auto; font-size:12px; font-family:Verdana; line-height:1.5;}
ul,dl,dd,h1,h2,h3,h4,h5,h6,form,p { padding:0; margin:0;}
ul { list-style:none;}
img { border:0px;}
a { color:#05a; text-decoration:none;}
a:hover { color:#f00;}

/* 全局样式 */
body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,form,fieldset,input,textarea,p,blockquote,th,td{margin:0;padding:0;}
body{font:12px/2 Arial,\5B8B\4F53,Helvetica,sans-serif ;}
html{color:#333;}
img{border:0 none;display:inline-block;}
li,dt,dd{list-style:none;}
table{border-collapse:collapse;}
a{text-decoration:none;color:#333;}
html a:hover{text-decoration:none;color:#f60;}
.clear10{display:block;clear:both;height:10px;line-height:0;font-size:0;}
.clear{display:block;clear:both;height:0;line-height:0;font-size:0;}
.clearfix:after {content:".";display:block; height:0;clear:both;overflow:hidden;visibility:hidden;}
.fl{display:inline;float:left;}
.fr{display:inline;float:right;}
button{cursor:pointer;}
/* 全局样式 */

清除浮动
.blank10 { clear:both; height:10px; line-height:10px; font-size:10px; overflow:hidden;}
.blank20 { clear:both; height:20px; line-height:20px; font-size:20px; overflow:hidden;}
.clearfloat {clear:both;height:0;font-size: 1px;line-height: 0px;}
.clearfix:after { clear:both; height:0; display:block; visibility:hidden; content:".";}
/*Clear floats *The Magnificent CLEARFIX:Updated fo prevent margin-collapsing on child elements */ .clearfix:before, .clearfix:after { content:"\0020"; display: block; height: 0; visibility: hidden; } .clearfix { zoom: 1;/*IE<8*/ } .clearfix:after { clear: both; } * html .clearfix { zoom: 1; /* IE6 */ } *:first-child+html .clearfix { zoom: 1; /* IE7 */ }

.body{overflow:hidden; _overflow:visible; _zoom:1;}
.main{overflow:hidden; _overflow:visible; _zoom:1;}

/* 禁止换行 */
.nowrap{word-break:keep-all;white-space:nowrap;}
/* 强制换行 */
.break{word-break:break-all;}
  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值