奇怪的clear:right…..

不知道是在哪位神仙的网站上看到这段代码,觉得很有趣,却百思不得其解。。。
放在这里,慢慢研究。

示例页面:/examples/clear-right.html

各浏览器效果:

.wrapper{
width:150px;
border:3px #666 solid;
padding:3px;
background-color:#efefef;
}
.sbox{
clear:right;/*注意,就是这个神奇的clear*/
float:left;
width:100px;
height:100px;
border:1px #000 solid;
background-color:#ccc;
}
Content
Content

待续….

评论(1)

  1. evangeline
    Posted 2010年01月27日 at 16:02 | Permalink

    你需要在.wrapper里面添加float:left属性;并且在.sbox里面将clear:right改为clear:both;

发表评论

Your email is never shared. Required fields are marked *

*
*