zhanglunray 问:
我在mzzx_pic这个层设置了左边距,在ie里显示是正常的,但是在ff里显示时margin-left却没有起到作用,好像变成只有一半的边距。导致了显示的时候这个层遮住了后面画的边框线。
<!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>IE margin双倍边距问题</title> </head> <style type="text/css"> .main2_right{ width:300px; float:right; height:200px; background:url("/article/UploadPic/20089/7/200897151036116.gif") no-repeat; clear:both} .mzzx_pic{ width:110px; height:145px; margin-left:7px; margin-top:39px; float:left; clear:left}/*每周之星*/ .server{ width:120px; height:120px; margin-right:6px; margin-top:60px; float:right; overflow:hidden}/*便捷服务总列表*/ .server_logo{ width:115px; height:30px; margin:0 auto; text-align:30px; line-height:30px; border-bottom:#CCCCCC 1px dashed}</style> <body><div class="main2_right"> <div class="mzzx_pic"><iframe name=xuaspic74 src=http://www.baidu.com marginwidth=1 marginheight=1 width=110 height="145" scrolling="no" border="0" frameborder="0"></iframe></div> <div class="server"> <div class="server_logo"><a href="#"> +学校概貌指南</a></div> <div class="server_logo"><a href="#"> +网站地图导航</a></div> <div class="server_logo"><a href="#"> +网站使用帮助</a></div> <div class="server_logo"><a href="login.asp"> +管理登陆</a></div> </div> </div> </body> </html> [提示:你可先修改部分代码,再按运行]
jnnvos 答:
ie6吧?
设置左浮动后会产生双边距,这不是firefox的错误,是ie的bug。
解决方法加上display:inline