14. Margin and Padding Properties
14. Margin and Padding Properties
- margin: length | percentage | auto
- Set margin width.
Percentage is relative to the width of the containing block.
- padding: length | percentage
- Set padding width.
- margin and padding actually take up to 4 values:
top right bottom left.
-
Right defaults to the same as top.
Bottom defaults to the same as top.
Left defaults to the same as right.
- margin-{top,right,bottom,left}
- Sets the size of a margin on one side.
- padding-{top,right,bottom,left}
- Sets the size of the padding between the content and border, on one side.
Ken Keys, CAIDA, 2006-12-01