javascript STYLE marginBottom, marginLeft, marginRight, marginTop

marginBottom, marginLeft, marginRight, marginTopNN 6 IE 4 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


1869,Nickname,Homepage or email,Comments here,Add comment