简体   繁体   English

IE中的Div高度不同与Firefox和Chrome比较

[英]Div height is Different in IE Compare with Firefox and Chrome

When I add the height to div tag It is not same height ie and firefox. 当我将高度添加到div标签时,它的高度即与Firefox不同。 I cannot put 100% on the div tag. 我不能100%放在div标签上。 Can you please any Help me to fix this issue. 您能帮我解决此问题吗? I have attached Css Code here, Please Click here to see the site. 我已经在此处附加了CSS代码,请单击此处查看站点。

#payment{
    width: 265px;
    border: 1px solid #cecece;
    border-radius: 8px;
    -webkit-box-shadow: 0 2px 7px rgba(50,50,50,0.46);
    -moz-box-shadow: 0 2px 7px rgba(50,50,50,0.46);
    box-shadow: 0 2px 7px rgba(50,50,50,0.46);
    -moz-border-radius: 8px;
    -webkit-border-radius: 8px;
    display: block;
    position: absolute;
    float: right;
    height: 230px;
    padding: 10px;
    left: 549px;
}

This could be an issue with padding. 这可能是填充问题。 IE and firefox parse padding differently. IE和Firefox解析填充的方式有所不同。 Firefox adds padding with height/width of the div (so the total height/width will be defined height/width+padding) wherein IE doesn't add that. Firefox使用div的高度/宽度添加填充(因此,总的高度/宽度将定义为height / width + padding),其中IE不会添加。 This occurs with older versions (< IE9). 在较旧的版本(<IE9)中会发生这种情况。

You can try following for older versions of IE. 您可以尝试使用IE的较早版本。

<!--[if lt IE 9]>
#payment{
    width: 285px; /* original width + padding on left and right */
    height: 250px;/* original height + padding on top and bottom */
    padding: 10px;
}
<![endif]-->

Looks like you're using a Quirk mode doctype on the page. 看起来您在页面上使用的是Quirk模式文档类型。

Switch the 切换

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

to

<!DOCTYPE>

or something more proper than a quirk mode. 或比怪癖模式更合适的东西。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM