Margin Properties |
|||
Comments: These properties let you specify where an element gets placed within its "box." | |||
Property | Description | Values | Example |
margin-top | Places the top margin of the element; you can use negative values. **NOTE: For some reason, IE4.0 treats this style command like the padding properties, i.e. it will add space to the top of every cellif done with a table. With <div> the property works normally. |
XX units % auto |
div {margin-top: 2em} Displays the top margin of the division 2 em spaces down the page. |
margin-bottom | Places the bottom margin of the element; you can use negative values. **See the note for margin-top |
XX units % auto |
div {margin-bottom: 10%} Places the bottom margin of the div element 10 percent down the page and diplays the element from the bottom up. |
margin-left | Places the left margin of the element; you can use negative values. | XX units % auto |
div {margin-top: 6em} Displays the left margin of the division 6 em spaces from the left of the page. |
margin-right | Places the right margin of the element; you can use negative values. | XX units % auto |
div {margin-right: 1em} Displays the right margin of the division 1 em space from the right edge of the page. |