Deprecated in HTML5. Do not use.

<body topmargin=””>

Sharing is caring!

Attribute of
HTML Body Tag Before And After HTML5: What's The Difference?
What does <body topmargin=""> do?
Was used to set a margin above the body of a document. Deprecated. Use CSS.

Use CSS instead

All of the styling and display attributes of the <body> (and all other elements) have been deprecated in HTML5. You can control the margins on the body using CSS.

body {  margins: 1em; } 

The CSS property for just the margin on the top of an element is margin-top (not topmargin).

body {  margin-top: 1em; } 

However, it is usually a better idea to use padding on the <body>, rather than margin. This is because any background properties you set (background-color, background-image) will be displayed within the bounds of the padding, but not within the margin. Since the usual desired behavior is for the background to fill the entire viewport (browser window), padding is usually the best choice.

body {  padding: 1em; } 
Adam is a technical writer who specializes in developer documentation and tutorials.