IE8开发者工具缺少一些样式
我在 IE8 中遇到一些 CSS 属性问题。
我已经在 IE7、Chrome 和 Firefox 中测试了我的网站,它们工作正常,但 IE8 存在一些布局问题。
我检查了 ie8 上的开发人员工具选项,发现我在 CSS 中设置的一些属性被 ie8 忽略了。例如:
#header
{
position: relative;
padding: 20px;
height: 100px;
background:url(header.png);
}
在此标头中,IE8 忽略了 height 属性: 如果我在开发人员工具中检查该元素,它会缺少该属性,并且会被压缩成另一行:
background:url;HEIGHT: 100PX
浮点数也会发生同样的情况:
#logon
{
float: left;
text-align:right;
width:20%;
height: 40px;
padding-left: 0px;
padding-right:7px;
border:0;
margin:0;
background: url(navgradient.gif);
}
这会忽略浮点数:
background: url(navgradient.gif); FLOAT:left;
这里发生了什么以及如何修复它?
I'm having some problems with some CSS properties in IE8.
I've tested my site in IE7, Chrome and Firefox and they work fine but IE8 is having some layout issues.
I inspect the developer tool option on ie8 and I've noticed that some of the properties I set in CSS are being ignored by ie8. For example:
#header
{
position: relative;
padding: 20px;
height: 100px;
background:url(header.png);
}
In this header IE8 ignored the height property:
If I inspect the element in developer tools it is missing that property and it's crushed into another line:
background:url;HEIGHT: 100PX
The same thing happens for floats too:
#logon
{
float: left;
text-align:right;
width:20%;
height: 40px;
padding-left: 0px;
padding-right:7px;
border:0;
margin:0;
background: url(navgradient.gif);
}
This ignores the float value:
background: url(navgradient.gif); FLOAT:left;
What is happening here and how can I fix it?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我也见过这个。有些样式显示在同一行上,对我来说是“过滤”行。
HTML 在 IE 中正确呈现,但如果您尝试打开/关闭该 CSS 行,则会影响这两个属性。因此,在开发工具中取消选中“filter: alpha(opacity=25); BOTTOM: 10px”会禁用“filter”和“bottom”CSS 规则。
所以这看起来像是开发工具解析器中的错误,而不是 IE 渲染引擎中的错误。太疯狂了,这个问题还没有解决。
I've seen this too. Some styles are shown on the same line, happens to me with "filter" lines.
The HTML renders in IE correctly, but if you try to toggle that CSS line on/off, it affects both properties. So unchecking "filter: alpha(opacity=25); BOTTOM: 10px" in dev tools disables both the "filter" and "bottom" CSS rules.
So it seems like a bug in dev tools' parser, but not the IE rendering engine. It's crazy how this still isn't fixed.
看起来像是解析错误或类似错误。尝试在图像名称周围加上引号;
Seems like a parse error, or similar. Try putting quotes around the image names;
如果样式表包含
filter
属性,我就见过这种情况。I've seen this happen if the stylesheet contains
filter
properties.