最近写网页,用DIV加CSS实现,发现DIV嵌套时,当内嵌浮动div的时候不能正常扩展
<div style="border-style:solid">
<div style = "float:right;border-style:solid">dsfsdfsd<div>
</div>
发现内层div会越界,在网上找了一下:
<div style="border-style:solid">
<div style = "float:right;border-style:solid">dsfsdfsd<div>
<div style="font: 0px/0px sans-serif;clear: both;display: block">
</div>
加这么一句就好了,顺便查到了一个在firefox中解决的方法:
<div style="border-style:solid">
<div style = "float:right;border-style:solid">dsfsdfsd<div>
<br clear="alll">
</div>