CSS padding-bottom Property

Beginner
⏱️ 5 min read
📚 Updated: Jun 2026
🎯 4 Examples
Box Model & Spacing

What You’ll Learn

The padding-bottom property sets inner spacing on the bottom edge of an element. Padding is the space between the content and the border, and bottom padding gives content breathing room below the text or media inside the box.

01

Bottom Edge Only

One physical side.

02

Syntax

Single value.

03

Units

px, em, rem, %.

04

Box Model

Inside the border.

05

Default 0

No spacing by default.

06

padding

Four-side shorthand.

Introduction

The padding-bottom property in CSS is used to set the padding area on the bottom of an element. Padding is the space between the content of the element and its border.

The padding-bottom property allows you to control the vertical spacing within an element, providing a way to create visual separation and layout consistency.

Definition and Usage

Apply padding-bottom when you need extra room below the content inside an element — for example, under a paragraph in a card, below a button in a toolbar, or at the foot of a content block before the bottom border.

Like all padding properties, padding-bottom increases the visible size of an element’s background and border box. It never collapses and always stays inside the element’s border.

💡
Beginner Tip

Use padding-bottom for inner spacing below content. Use margin-bottom when you need space outside the element, between this box and the next one.

padding-bottom → space below content Always the physical bottom edge

📝 Syntax

The syntax for the padding-bottom property is simple. You can specify the padding using various units, including pixels, ems, percentages, and more.

syntax.css
element {
  padding-bottom: value;
}

Here, value can be a length (e.g., px, em, rem), a percentage (%), or the keyword auto.

Basic Example

padding-bottom.css
.box {
  border: 1px solid #000;
  padding-bottom: 20px;
  background-color: lightgray;
}

Syntax Rules

  • Apply padding-bottom to any element that needs extra inner space below its content.
  • The value is a length, percentage, or auto.
  • The property is not inherited — child elements do not automatically get the parent’s bottom padding.
  • Percentage padding is calculated relative to the width of the containing block.

⚡ Quick Reference

QuestionAnswer
Initial value0
Applies toBottom padding side only
InheritedNo
AnimatableYes, as a length
Common useCards, paragraphs, buttons, and any content that needs room above the bottom border

🎯 Default Value

The default value of the padding-bottom property is 0. This means that if no value is specified, there will be no padding at the bottom of the element.

💎 Property Values

ValueExampleDescription
Lengthpadding-bottom: 10px;Specifies the bottom padding in fixed units such as px, em, or rem.
Percentagepadding-bottom: 5%;Specifies the bottom padding as a percentage of the containing element’s width.
autopadding-bottom: auto;Allows the browser to calculate the bottom padding automatically. This value is rarely used with padding properties.
initialpadding-bottom: initial;Resets to the initial value (0).
inheritpadding-bottom: inherit;Inherits the value from the parent element.
padding-bottom: 20px; padding-bottom: 1.5rem; padding-bottom: 5%;

👀 Live Preview

Four boxes with the same content and different pb- utility classes showing increasing bottom inner spacing:

pb-sm
pb-md
pb-lg
pb-xl

Examples Gallery

Start with the reference box example, try different bottom values, add spacing in stacked layouts, and compare physical bottom padding with logical block-end padding.

🔢 Basic padding-bottom

Start with the reference example — bottom padding on a div with a border and light gray background.

Example 1 — Box with Bottom Padding

In this example, we’ll add padding to the bottom of a <div> element.

padding-bottom-example.html
<style>
  .box {
    border: 1px solid #000;
    padding-bottom: 20px;
    background-color: lightgray;
  }
</style>

<div class="box">
  This box has a padding-bottom of 20px.
</div>
Try It Yourself

How It Works

The .box class applies a bottom padding of 20px, creating space between the content and the border of the div. The gray background fills the padding area so you can see the gap.

Example 2 — Different Bottom Values

Use rem units for scalable bottom spacing that grows with root font size.

padding-bottom-rem.css
.compact {
  padding-bottom: 0.5rem;
}

.comfortable {
  padding-bottom: 1.5rem;
}

.spacious {
  padding-bottom: 2.5rem;
}
Try It Yourself

How It Works

Each class sets a different bottom padding while leaving the top and sides unchanged. The background fills the padding area so you can compare the spacing visually.

🛠 Layout Patterns

Apply bottom padding to cards and compare physical vs logical properties.

Example 3 — Card Footer Spacing

Add bottom padding to a card body so content does not crowd the bottom border or footer area.

padding-bottom-card.css
.card-body {
  padding-inline: 1.25rem;
  padding-top: 1rem;
  padding-bottom: 1.75rem;
  border: 1px solid #e2e8f0;
  border-radius: 0.5rem;
}
Try It Yourself

How It Works

Extra padding-bottom gives the last line of text more room above the card’s bottom edge. This is a common pattern when the bottom border or footer sits close to the content.

Example 4 — Physical vs Logical Bottom Padding

Compare padding-bottom with padding-block-end.

padding-bottom-logical.css
/* Physical — fixed to bottom edge */
.physical {
  padding-bottom: 24px;
}

/* Logical — follows writing mode */
.logical {
  padding-block-end: 24px;
}
Try It Yourself

How It Works

In horizontal English layouts, both approaches look the same. padding-block-end stays correct when writing mode changes; physical bottom padding does not.

padding-bottom vs padding, padding-block-end & margin-bottom

The padding shorthand sets padding on all four sides at once. Use padding-bottom when you need spacing on only the bottom edge.

padding-block-end is the logical equivalent that follows the block axis. Use padding-bottom for simple physical layouts; prefer padding-block-end in multilingual or vertical writing-mode designs. Remember: margin-bottom adds space outside the border, not inside it.

padding-bottom-companion.css
/* Bottom only */
.card-body {
  padding-bottom: 1.25rem;
}

/* All four sides via shorthand */
.section {
  padding: 1rem 2rem;
}

/* Space below the element (outside border) */
.article {
  margin-bottom: 2rem;
}

♿ Accessibility

  • Improve readability — Paragraphs and card content benefit from bottom padding so text does not crowd the bottom border.
  • Touch targets — Buttons and links inside padded containers are easier to tap when bottom padding gives them room.
  • Do not hide content — Very large bottom padding on small screens can push important content out of view.
  • Keep focus visible — Padding adjusts inner spacing; it should not replace visible focus outlines on interactive elements.
  • Test zoomed layouts — Users who zoom in rely on comfortable padding to keep text readable.

🧠 How padding-bottom Works

1

You set a padding value

Write padding-bottom: 20px; with a length, percentage, or auto.

CSS rule
2

Browser adds space on the bottom

Padding is inserted between the content edge and the border on the bottom side only.

Box model
3

Background fills the padding area

The element’s background color and background image extend into the padding box, making the gap visible.

Rendering
=

Comfortable bottom spacing

Content has breathing room below it without affecting spacing on other sides or outside the border.

Browser Compatibility

The padding-bottom property is well-supported across all modern browsers, including Chrome, Firefox, Safari, Edge, and Opera. It is a fundamental CSS property, so you can use it confidently knowing it will work consistently across different platforms.

Universal · All browsers

Bottom padding works everywhere

Chrome, Firefox, Safari, Edge, Opera, and Internet Explorer all support padding-bottom as a core box-model property.

100% Universal support
Google Chrome All versions · Desktop & Mobile
Full support
Mozilla Firefox All versions · Desktop & Mobile
Full support
Apple Safari All versions · macOS & iOS
Full support
Microsoft Edge All versions · Legacy & Chromium
Full support
Opera All versions
Full support
padding-bottom property 100% supported

Bottom line: padding-bottom is one of the most reliable CSS properties. Safe to use in any project without fallbacks.

Conclusion

The padding-bottom property is a crucial tool in CSS for managing the layout and spacing of elements.

By controlling the padding, you can create a clean and visually appealing design, ensuring that elements are appropriately spaced. Whether you’re designing a complex web application or a simple webpage, understanding how to use padding properties effectively is essential.

💡 Best Practices

✅ Do

  • Use padding-bottom for inner spacing below content
  • Prefer rem or em for scalable bottom spacing
  • Pair with padding-top for asymmetric vertical rhythm
  • Use the padding shorthand when all sides need spacing
  • Test on mobile to ensure bottom padding does not waste screen space

❌ Don’t

  • Confuse padding-bottom with margin-bottom for outer spacing
  • Use excessive bottom padding that pushes content off small screens
  • Forget that percentage padding is based on width, not height
  • Assume auto is useful for padding (it rarely is)
  • Use physical bottom padding when writing-mode-aware layouts need padding-block-end

Key Takeaways

Knowledge Unlocked

Five things to remember about padding-bottom

Use these points when spacing content on the bottom edge.

5
Core concepts
0 02

Default 0

No spacing.

Default
03

Inside Border

Part of box model.

Scope
% 04

Units

px, em, rem, %, auto.

Values
pbe 05

Not block-end

Physical vs logical.

Companion

❓ Frequently Asked Questions

The padding-bottom property sets inner spacing on the bottom edge of an element, between the content and the bottom border. It creates vertical room below the content inside the element.
The default value is 0, meaning no bottom inner spacing is applied unless you set padding-bottom explicitly.
padding-bottom adds space inside the element, between the content and the border. margin-bottom adds space outside the border, between this element and the element below it.
padding-bottom always targets the physical bottom edge. padding-block-end follows the block axis and stays correct when the writing mode changes, such as in vertical text layouts.
Yes. Percentage padding is calculated relative to the width of the containing block, even for bottom padding.

Practice in the Live Editor

Open the HTML editor, try different padding-bottom values, and see how bottom spacing changes your layout instantly.

HTML Editor →

About the author

Mari Selvan M P
Mari Selvan M P 🔗

Developer, cloud engineer, and technical writer

  • Experience 12 years building web and cloud systems
  • Focus Full Stack Development, AWS, and Developer Education

I write practical tutorials so students and working developers can learn by doing—from databases and APIs to deployment on AWS.

5 people found this page helpful