简体   繁体   English

Firefox / Safari / ie上边距,左边距0

[英]firefox/safari/ie top margin ,left margin 0

if i use 如果我用

<BODY TOPMARGIN=0 LEFTMARGIN=0 MARGINHEIGHT=0 MARGINWIDTH=0>

tag like this, will this ensure element i put in my html will displayed the same across all browser? 这样的标签,是否可以确保我在html中放入的元素在所有浏览器中都显示相同? the reason i asking this is because, i was told Internet explorer renedering of the page is slightly different .In other words, if i put img tag in a page and render it on Internet exploerer and render on firefox, maybe the coordinate of the img will slightly different because of margin/page border 我问这个的原因是因为,有人告诉我,Internet Explorer对页面的重新调整是略有不同的。换句话说,如果我将img标签放在页面中并在Internet exproerer上呈现并在firefox上呈现,则可能是img的坐标由于页边距/页面边框会略有不同

That isn't HTML. 那不是HTML。 It is a combination of obsolete propriety Netscapisms and obsolete propriety Microsoftisms. 它是过时的专有Netscapism和过时的专有Microsoftism的组合。

If you want to remove the default spacing around a document add: 如果要删除文档周围的默认间距,请添加:

html, body {
    margin: 0;
    padding: 0;
}

… to your stylesheet . …到您的样式表

That said, a leading cause of differences between browser renderings is poor choice of Doctypes . 也就是说,浏览器渲染之间差异的主要原因是Doctypes的选择不当 Also, given the question, you might not be aware of the useful QA tool: The W3C Markup Validation Service . 同样,给定问题,您可能不知道有用的质量检查工具: W3C标记验证服务

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

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