CSS PROPERTIES
Expand All|Collapse All
CSS AT-RULES
SPONSORED LINKS

CSS padding-bottom Property

Topic: CSS3 Properties Reference« Prev|Next »

Description

The padding-bottom CSS property sets the padding to the bottom side i.e. the amount of space between the bottom border and the content of an element. However in many cases the shorthand CSS property padding is more convenient to use and preferable.

The following table summarizes the usages context and the version history of this property.

Default value: 0
Applies to: All elements except <tbody>, <thead>, <tfoot>, <tr>, <colgroup> and <col>. It also applies to ::first-letter.
Inherited: No
Animatable: Yes. See animatable properties.
Version: CSS 1, 2, 3

Syntax

The syntax of the property is given with:

padding-bottom length | percentage | initial | inherit

The example below shows the padding-bottom property in action.

  • h1 {
  •     padding-bottom: 2em;
  • }
  • p {
  •     padding-bottom: 50px;
  • }

Property Values

The following table describes the values of this property.

Value Description
length Specifies the padding as a length value in px, pt, cm, em, etc. Negative length values are not allowed.
percentage Specifies the padding in percentage. The percentage is calculated with respect to the width of the element's containing block. Negative percentage values are not allowed.
initial Sets this property to its default value.
inherit If specified, the associated element takes the computed value of its parent element padding-bottom property.

Browser Compatibility

The padding-bottom property is supported in all major modern browsers.

Browsers Icon

Basic Support—

  • Firefox 1+
  • Google Chrome 1+
  • Internet Explorer 4+
  • Apple Safari 1+
  • Opera 4+

Further Reading

See tutorial on: CSS Padding, CSS Box Model.

Related properties: padding, padding-top, padding-right, padding-left.

 
Close

Your Feedback:

 

We would love to hear from you! Please say something.