margin | NN 4 IE 4 CSS 1 | ||||||||||
  | Inherited: No | ||||||||||
A shortcut attribute that can set the margin widths of up to four edges of an element with one statement. A margin is space that extends beyond the border of an element to provide extra empty space between adjacent or nested elements, especially those that have border attributes set. You may supply one to four space-delimited margin values. The number of values determines which sides receive the assigned margins. | |||||||||||
CSS Syntax margin: marginThickness | auto {1,4} | |||||||||||
JavaScript Equivalent margins() | |||||||||||
Value This attribute accepts one, two, three, or four values, depending on how many and which margins you want to set. Values for marginThickness can be lengths, percentages of the next outermost element size, or the auto constant. Value quantities and positions are interpreted as follows:
| |||||||||||
Initial Value 0 | |||||||||||
Example P.highlight {margin: 10px 20px} | |||||||||||
Applies To All elements. | |||||||||||
Object Model Reference
|