Javascript Reference
Categories: STYLE

javascript STYLE marginBottom, marginLeft, marginRight, marginTop

@March 15, 2008, 1:22 a.m.
marginBottom, marginLeft, marginRight, marginTopFirefox/Netscape/NN 6 IE 4 Chrome/Safari/DOM 6  

Read/Write  

All four properties set the width of a single margin edge of an element. A margin is space that extends beyond the element's border and is not calculated as part of the element's width or height.

 
Example
 
document.getElementById("logoWrapper").style.marginTop = "5px";
document.getElementById("navPanel").style.marginLeft = "10%";
 
Value

Values for margin widths can be length values, percentages of the next outermost element size, or the auto constant.

 
Default

0


Powered by Linode.