日期:2014-05-17  浏览次数:21028 次

ie8下div高度不一致,不要嫌少,如果问题解决了会加分
我两个div在ie8下高度比别的div矮了一截,这两个div中的div(div有背景图片)还有大概10个像素的倒影似的区域,倒影的区域颜色比较浅。
在firefox和chrome下正常。
例如:
____________________________________________________
____________________________________________________
出错地方的层次关系如下,褐色区域显示出来高度短了:
<div name='view' style='position:relative;width:100%;clear:both;min-height:500px;height:auto !important;margin-bottom:5px'>
  <div id='leftsubmenu' style='position:relative;float:left;left:0px;top:0px;width:16%;height:498px ;background-color:#f0f5f8;border:1px solid;'>
  </div>
<div class='content' style='position:relative;float:left;width:920px;min-height:500px;height:auto !important;background-color:#F5F5DC;border:solid 2px #e5e5e5; margin:0px auto;padding-top:0px'>
<div style='font-weight:900;color:gray;margin: 0 auto;padding:0px;background-image:url("/res/title2_bg.png");height:38px'>
<h3 style="line-height:38px;margin-top:0px;padding-left:40%">Delete User</h3>
</div>

<form name='duser' method='get' action='deleteuser.php' style="width:90%;left:5%;margin:10px auto;">
<div id='duresult' class='result' style="visibility:hidden">
Delete User successful.
</div>

<div class='formrow'>
<label class="label" for="userid">User id</label>
<input type='text' id='userid' name='userid' class="input" maxlength=10 onblur="check()" />
<span id="uierror" class='error_tips' style="display:none"></span>
</div>

<div style="width:100%;height:40px;">
<a onclick='submitdu()' style="line-height:40px;text-align:center">
<div style="float:right;width:146px;height:42px;background-image:url('/res/ok.png');font-weight:700;margin-top:200px;margin-right:50px;padding:0px;text-align:center;">
<span style="line-height:40px;text-align:center">Delete</span>
</div>
</a>
</div>

</form>
</div>
</div>

如果我说得不清楚,可以上isquirrel2011.gicp.net,用户名demo,密码123456,user management下的delete user显示不正常,room management下的create room显示不正常

------解决方案--------------------
页面写的有问题,当浏览器非全屏浏览器,右边的DIV会被挤下去
------解决方案--------------------
最外层的DIV要固定宽度,不用设置定位方式,内层的DIV也要固定宽度好些,除非你要用到浮动层,否则不必要使用相对或绝对定位
------解决方案--------------------
貌似IE8标准模式下高度是正常的,混杂模式下高度就不对了。大概还是IE浏览器对min-height属性的支持有问题吧。
CSS Hack解决方法:
CSS code
/*修改类名为content的div的高度值定义*/
min-height:500px;height:auto !important; height:500px; overflow:visible;