+ -
当前位置:首页 → 问答吧 → 4个DIV浮动,怎么样才能让FF的效果和IE的效果一样。

4个DIV浮动,怎么样才能让FF的效果和IE的效果一样。

时间:2010-09-28

来源:互联网

4个DIV浮动,怎么样才能让FF的效果和IE的效果一样。
<!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=gb2312" /> <title>无标题文档</title> <style type="text/css"> .a,.b,.c,.d{text-align:center;} .left{float:left;} .clear{ clear:left;} .x{width:1000px;} .a{width:219px;height:58px;background-color:#FF99CC;} .b{width:712px;height:35px;background-color:#3B5998;} .c{width:219px;height:277px;background-color:#333333;} .d{width:727px;height:578px;background-color:#33CCFF;} </style> </head> <body> <div class="x"> <div class="a left"> A号DIV </div> <div class="b left"> B号DIV </div> <div class="c left clear"> C号DIV </div> <div class="d left"> D号DIV </div> </div> </body> </html>
 提示:您可以先修改部分代码再运行

作者: darkkelly   发布时间: 2010-09-28

1 给 a b 外层套一层DIV;
2 在 b c 之间增加一个空的clear DIV;
3 给b设置margin-bottom

作者: geminids   发布时间: 2010-09-29