IE7 DIV 之间的额外间距/填充
一直在浏览问题并谷歌搜索,但我似乎找不到解决此问题的方法。除了 IE7 之外,对于其他任何地方的 Grid 来说,布局看起来都非常完美(令人惊讶)。
http://lalive-branch.aeg-webdev.com/
这些框应该都在里面彼此相差 5 个像素,但在 IE7 中,div 下面的间距完全被搞乱了。我进行了一些修复,试图最大限度地减少浏览器之间的显示差异,但这一个完全让我困惑。
任何见解或帮助将不胜感激。请忽略jquery错误和喜欢的:),谢谢。
Been browsing the questions and Googling it but I can't seem to find a fix for this issue. The layout looks perfectly fine for the Grid anywhere else except for IE7 (surprise).
http://lalive-branch.aeg-webdev.com/
The boxes should all be within 5 pixels of each other, but in IE7 the spacing below divs get botched up completely. There are a few fixes I put to try to minimize the display differences between browsers, but this one just boggles my mind completely.
Any insight or help would be greatly appreciated. Please ignore the jquery error and the likes :), thank you.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
删除 css 代码中的
clear:both
:然后它将在所有浏览器上运行。
Remove:
clear:both
inside your css code for:Then it will work on all browsers.
你必须使用脚本来解决CSS的这个错误。
在你的核心中,你必须创建一个 javascript,并且这个脚本你必须创建一种方法,如下所示。
if(浏览器版本 == 7 || 浏览器版本 == 8){
document.getElementById("your_div").style.padding = 根据需要填充。
}
别的{
document.getElementById("your_div").style.padding = 默认填充。
我认为
这可以帮助您解决浏览器 CSS 错误。
you have to use script for solve this error of css.
in your core you have to create one javascript and this script you have to create one method like as below.
if(browser_version == 7 || browser_version == 8){
document.getElementById("your_div").style.padding = padding as you want.
}
else{
document.getElementById("your_div").style.padding = default padding.
}
i think this can help you for Browser CSS Error.
您必须在CSS中进行一些更改:
1)在.gridRow内部删除clear:both然后您应该考虑添加overflow属性并将所有边距和填充放入.gridRow内.gridBox 的。这是更好的做法,因为当布局更改时您只需要更改一个类。
You have to make few changes inside your CSS:
1) Inside .gridRow remove clear: both then you should consider adding overflow attribute and put all margins and paddings inside .gridRow insted of .gridBox. It's better practise because you need to change only one class when your layout get changed.
如果您只需要 IE7 样式,您可以将以下内容添加到您的标签中:
If you want IE7 styles only, you can add the following to your tag: