Name
margin-bottom, margin-left, margin-right, margin-top — NN 4 IE 4 CSS 1
Synopsis
Inherited: No
All four attributes 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.
CSS Syntax
margin-bottom:marginThickness| auto margin-left:marginThickness| auto margin-right:marginThickness| auto margin-top:marginThickness| auto
JavaScript Equivalent
marginBottom marginLeft marginRight marginTop
Value
Values for marginThickness can be
lengths, percentages of the next outermost
element size, or the auto constant.
Initial Value
0
Example
BLOCKQUOTE {margin-left: 20; margin-top: 10}
#narrowCol {margin-left: 30%; margin-right: 30%}Applies To
All elements.
Object Model Reference
- IE
[window.]document.all.elementID.style.marginBottom[window.]document.all.elementID.style.marginLeft[window.]document.all.elementID.style.marginRight[window.]document.all.elementID.style.marginTop
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access