views:

541

answers:

1

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? 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

+3  A: 

That isn't HTML. It is a combination of obsolete propriety Netscapisms and obsolete propriety Microsoftisms.

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. Also, given the question, you might not be aware of the useful QA tool: The W3C Markup Validation Service.

David Dorward
does that mean if i use doctype, i no need to put the above code margin0,padding0?
cometta
Doctypes must be the very first thing in the document. Setting the margin and padding must be done in the stylesheet, I linked to a tutorial about using stylesheets above.
David Dorward
argh! I'm getting flashbacks to 1997! Dark times...
bobince