padding-bottom 6g1a4t
The padding-bottom property is used to specify the width of the bottom area of the element’s padding box. That is, it specifies the area of space required at the bottom of the element’s content, inside any defined border. 36312d
Every element on a web page is rectangular. Each element has a rectangular box model, which describes each of the rectangular boxes (areas) generated for the element: the content box, the padding box, the border box, and the margin box. The content box exists for every element. The padding, border, and margin boxes are optional, and their existence depends on whether you apply a padding, border, or margin to an element.

The padding of an element is usually used to calculate the width and height of an element. The width is usually equal to the width
is set to ‘300px’, and the width of its padding (left and right) sums up to ’60px’, then the total computed width of the element is ‘360px’, not ‘300px’. The same reasoning applies to the computed height of the element.
This calculation of the element’s height and width can change when the width
property, and its padding width is set to ’60px’, then the total width will remain ‘300px’, and the width of the content area of the element will decrease from ‘300px’ to ‘240px’.
Using box-sizing: border-box;
and is now the recommended practice in CSS.
You can read more about this in the box-sizing
property entry. Also, see the demo section below for a live example.
Official Syntax 3xs5l
- Syntax:
padding-bottom: <length> | <percentage>
- Initial: 0
- Applies To: all elements except table-row-group, table-header-group, table-footer-group, table-row, table-column-group and table-column
- Animatable: yes, as a length
Values u704t
- <length>
- See the <length> entry for a list of possible values.
- <percentage>
- See the <percentage> entry for a list of possible values. A percentage value is calculated with respect to the width of the element’s containing block.
Notes 441w3q
The padding can not be negative. An element can also inherit its padding value from its parent’s using the inherit
keyword. For example:
.element { padding-bottom: inherit; }
Examples 2h2053
The following sets the bottom padding of an element:
.container { padding-bottom: 30px; } .container-2 { padding-bottom: 15%; } .sub-container { padding-bottom: inherit; }
Live Demo 6b4m17
View this demo on the Codrops PlaygroundBrowser 572e63
The padding-bottom
property works in all major browsers: Chrome, Firefox, Safari, Opera, Internet Explorer, and on Android and iOS.