padding-bottom
Quick Summary for padding-bottom
Code Usage for padding-bottom
/* <length> values */ padding-bottom: 0.5em; padding-bottom: 0; padding-bottom: 2cm; /* <percentage> value */ padding-bottom: 10%; /* Global values */ padding-bottom: inherit; padding-bottom: initial; padding-bottom: revert; padding-bottom: unset;
More Details for padding-bottom
padding-bottom
The padding-bottom
CSS property sets the height of the padding area on the bottom of an element.
An element's padding area is the space between its content and its border.
Note: The padding
property can be used to set paddings on all four sides of an element with a single declaration.
Syntax
/* <length> values */ padding-bottom: 0.5em; padding-bottom: 0; padding-bottom: 2cm; /* <percentage> value */ padding-bottom: 10%; /* Global values */ padding-bottom: inherit; padding-bottom: initial; padding-bottom: revert; padding-bottom: unset;
The padding-bottom
property is specified as a single value chosen from the list below. Unlike margins, negative values are not allowed for padding.
Values
<length>
The size of the padding as a fixed value. Must be nonnegative.
<percentage>
The size of the padding as a percentage, relative to the width of the containing block. Must be nonnegative.
Formal definition
Initial value | 0 |
---|---|
Applies to | all elements, except table-row-group , table-header-group , table-footer-group , table-row , table-column-group and table-column . It also applies to ::first-letter and ::first-line . |
Inherited | no |
Percentages | refer to the width of the containing block |
Computed value | the percentage as specified or the absolute length |
Animation type | a length |
Formal syntax
<length> | <percentage>
Examples
Setting padding bottom with pixels and percentages
.content { padding-bottom: 5%; } .sidebox { padding-bottom: 10px; }
Specifications
Specification |
---|
CSS Box Model Module Level 3 # padding-physical |
See also
Introduction to the CSS basic box modelpadding-top
, padding-right
, padding-left
and the padding
shorthand The mapped logical properties: padding-block-start
, padding-block-end
, padding-inline-start
, and padding-inline-end
and the shorthands padding-block
and padding-inline
Last modified: Jan 31, 2022, by MDN contributors
Select your preferred language English (US)DeutschEspañolFrançais日本語한국어中文 (简体) Change language Posted in
12:22 am, February 22, 2022
Add Comment
Other Items in CSS
rgb()
rgba()
:right
right
@right-bottom
:root
rotate
rotate()
rotate3d()
rotateX()
rotateY()
rotateZ()
row-gap
ruby-align
ruby-position
saturate()
scale
scale()
scale3d()
scaleX()
scaleY()
scaleZ()
:scope
scroll-behavior
scroll-margin
scroll-margin-block
scroll-margin-block-end
scroll-margin-block-start
scroll-margin-bottom
scroll-margin-inline
scroll-margin-inline-end
scroll-margin-inline-start
scroll-margin-left
scroll-margin-right
scroll-margin-top
scroll-padding
scroll-padding-block
scroll-padding-block-end
scroll-padding-block-start
scroll-padding-bottom
scroll-padding-inline
scroll-padding-inline-end
scroll-padding-inline-start
scroll-padding-left
scroll-padding-right
scroll-padding-top
scroll-snap-align
scroll-snap-stop
scroll-snap-type
@scroll-timeline