September 2014
Intermediate to advanced
148 pages
2h 15m
English
CHAPTER 19
![]()
Margin and padding
Margins and padding are used to adjust the position of an element and to create space around it.
Padding
Padding is the space between an element’s content and its border. It is set using the padding properties shown here. These properties do not inherit and can be applied to any element.
padding (1-4) | padding-top | padding-right |padding-bottom | padding-left : <length> | <percentage>
There are four properties for setting the padding on each side individually. In the following example, the vertical (top, bottom) margins will be 10 pixels, and the horizontal (right, left) margins will be zero.
padding-top: 10px; ...Read now
Unlock full access