关于BFC的小例子

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>关于BFC详解</title>
<link rel="stylesheet" href="base.css" type="text/css" />
<style type="text/css">
.time{width:300px; border:1px solid #F6C;}
/*浮动 title 之后cont的内容就包裹图片了 ,可这并不是我想要的效果--- 加入overflow:hidden 触发BFC 但是在IE 6下又有问题了,。。。。OK 触发私有就可以了 _height:1% _zoom:1; overflow:hidden IE7 已经即触发haslayout 有触发BFC 所以不用管IE 7 指针对IE6*/
.time .time-title{ margin:10px; color:#000; font-weight:bold;width:80px; height:80px; background:#669; text-align:center; line-height:80px; float:left; display:inline;}/**/
.time .time-cont{margin:10px; overflow:hidden;_zoom:1;}
</style>
</head>

<body>
<div class="time ClearFix">
    <h2 class="time-title">here title!! </h2>
    <div class="time-cont"> 爱饭否,爱豆瓣,也爱鸡脱壳。爱爬山,爱拍美景。爱腐败,更爱远征的自虐。爱下雪天,爱感动,爱平底鞋。我没有什么特别,我很特别。 我和别人不一样,我和你一样。
    我是前端。
    </div>
</div>
</body>
</html>

转载于:https://my.oschina.net/blogsDdc/blog/100566

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值