【发布时间】:2015-07-09 01:51:57
【问题描述】:
我有一个在 IE8 上难以解决的问题。我需要一个 100% 高度的 div,但我尝试过的所有方法都不能解决问题。
你可以在这里看到问题:http://gyazo.com/71ffde560df4d3f87c0fb55a92ef8313
或在此处复制:http://maahes.ninja/ie/ie.html
问题是页面底部的白色边距很小,而且这只发生在 ie8 上(在 ie9 上没问题)。我能够通过删除 doctype 来解决它,但它可以解决问题,但会破坏所有应用程序。
CSS:
html,body,div,span,applet,object,iframe,
h1,h2,h3,h4,h5,h6,p,blockquote,pre,
a,abbr,acronym,address,big,cite,code,
del,dfn,em,img,ins,kbd,q,s,samp,
small,strike,strong,sub,sup,tt,var,
b,u,i,center,
dl,dt,dd,ol,ul,li,
fieldset,form,label,legend,
table,caption,tbody,tfoot,thead,tr,th,td,
article,aside,canvas,details,figcaption,figure,
footer,header,hgroup,menu,nav,section,summary,
time,mark,audio,video{
margin:0;
padding:0;
border:0;
outline:0;
font-size:100%;
font:inherit;
vertical-align:baseline;
}
html {
height: 100%;
}
body {
height: 100%;
}
div {
height: 100%;
min-height: 100%;
background:#9699FF;
color:#fff;
}
很抱歉没有添加更多图片/链接,但我对此毫无名气。
【问题讨论】:
-
没有图片也没关系;代码无限好。
-
我没有看到使用 ie11 设置为 ie8 标准和模式的边距
-
@Pete 我使用真正的 ie8 进行了测试(在 VM 中,但仍然存在),问题就在那里 :(
标签: html css internet-explorer-8