如何使 html 填充在不同浏览器中看起来相同?
我有一个博客,www.realcanadianenglish.blogspot.com。 我用火狐来写。 有时我会使用 Internet Explorer 查看博客。 对于后者,有时会显示图片和文字之间的差距。 我可以更改 HTML 代码来解决此问题吗? 为什么 Explorer 和 Firefox 这两者之间存在差异?
I have a blog, www.realcanadianenglish.blogspot.com. I use Firefox to write it. Sometimes I check the blog using Internet Explorer. With the later it shows a gap between the picture and the text sometimes. Can I change the HTML code to fix this? Why is there a difference between the two: Explorer and Firefox?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
Internet Explorer 可以在某些元素上有额外的填充。 我建议您尝试首先包含 CSS Reset 文件,然后包含您自己的 CSS 文件。
这是一个关于 CSS 重置文件的 Stackoverflow 好问题
Internet Explorer can have extra padding on some elements. I suggest you try to include a CSS Reset file first and then your own CSS file.
Here's a good Stackoverflow question about CSS Reset files
该博客在 IE8 上看起来不错。 如果您遇到问题,我建议运行 IE8 并使用提供的调试工具(按 F12)。 您可以从浏览器内部动态更改 HTML 和 CSS。 这比每次想要测试更改时上传新模板要快。
The blog looks fine on IE8. If you're having a problem with it, I would recommend running IE8 and using the debug tool provided (hit F12). You can dynamically change the HTML and CSS from right inside the browser. It's faster than uploading a new template every time you want to test a change.
您指的是 IE 模型错误
You are refering to the IE Model Bug
在大多数情况下,问题出在 IE 上,在这些情况下,有时最好的,或者至少是方便的,只为 IE 提供一两行,使其与其他更现代的浏览器使用“条件注释”保持一致。 这些注释只能被 IE 识别,但最终允许您包含不会影响其他浏览器的样式或 html。 它们易于使用,但根据您所针对的 IE 版本而有一些变化。 以下是解释所有内容的链接: http://msdn .microsoft.com/en-us/library/ms537512(VS.85).aspx
In most cases the issue will be with IE and, in those cases, it's sometimes best, or at least convenient, to just serve IE a line or two to bring it into line with the other far more modern browsers with "conditional comments". These comments will be recognized only by IE but wind up allowing you to include styling or html that won't affect other browsers. They are easy to use but have a few variations based on which version of IE you are targeting. Here is the link explaining them all: http://msdn.microsoft.com/en-us/library/ms537512(VS.85).aspx
这里是了解 IE CSS bug 的最佳位置: http://www.positioniseverything.net/ ie-primer.html
Here is the best place to learn about IE CSS bugs: http://www.positioniseverything.net/ie-primer.html