Home CSS Properties padding-bottom CSS padding-bottom Property Definition
Definition and Usage The padding-bottom property sets the inner padding on the physical bottom edge of an element — the space between the content and the bottom border.
It is a longhand of the padding shorthand. Unlike padding-block-end , it always means bottom, even if writing-mode changes. It is not inherited. The initial value is 0. Negative values are invalid.
Baseline · Widely available. Not deprecated. Supported in all modern browsers and Internet Explorer. Safe for everyday layouts.
Physical tip. Use padding-bottom when you mean a fixed screen edge. Prefer padding-block-end when spacing should follow writing mode.
Syntax
CSS Syntax padding-bottom: <length> | <percentage> | initial | inherit ;
One non-negative length or percentage. There is no auto (unlike margin-bottom ).
Values
Property Values Value Description Try it <length>Fixed size such as 1.5rem or 24px Try it<percentage>Percent of the containing block width Try itAlways bottom Stays on the physical bottom even with vertical writing mode Try itAbsolute length Pixel value such as 24px Try itinitialResets to 0 Try itinheritInherits from the parent element Try it
Approach
How to Use padding-bottom Add room below the content, inside the border.
Decide how much space you need between the content and the bottom border. Set padding-bottom with a non-negative length or percentage. Use padding-top or the padding shorthand if other sides need padding too. Choose padding-block-end instead if the layout may switch writing mode. Try it
Live Preview The amber area is padding. Change padding-bottom — only the bottom edge grows.
Code
CSS Examples Each snippet focuses on padding-bottom. Use Try It Yourself for a live editor.
1. Length 2. Percentage 3. Always physical bottom Example 1 — Length Value A single length adds inner space on the bottom edge only.
<style>
.box {
padding-bottom: 1.5rem;
border: 1px solid #ccc;
}
</style>
<div class="box">Padded content</div> How It Works One side only. 1.5rem applies to the bottom, not the top.Inside the border. The amber gap sits between content and border.Other sides untouched. Top and left/right paddings stay at their own values.Not margin. This does not push neighboring elements away outside the box.Example 2 — Percentage Value Percentages resolve against the containing block width, even for bottom padding.
<style>
.wrap { width: 280px; }
.box {
padding-bottom: 5%;
border: 1px solid #ccc;
}
</style>
<div class="wrap">
<div class="box">5% bottom padding</div>
</div> How It Works Reference width. 5% uses the containing block’s width, not its height.Still bottom. The padding is added on the physical bottom edge.Scales with container. Wider parents produce larger bottom padding.Must be non-negative. Negative percentages are invalid.Example 3 — Always Physical Bottom Even with vertical writing mode, padding-bottom still pads the bottom edge.
<style>
.box {
writing-mode: vertical-rl;
padding-bottom: 1.5rem;
border: 1px solid #ccc;
}
</style>
<div class="box">Vertical text</div> How It Works Text turns vertical. writing-mode: vertical-rl changes the text flow.Padding stays bottom. padding-bottom still targets the physical bottom.Logical alternative. padding-block-end would follow the block axis instead.When to use which. Pick physical for fixed edges; logical for multilingual layouts. Edge Cases & Pitfalls Most confusion comes from mixing padding with margin, or expecting percentages to use height.
percent % uses width, not height padding-bottom: 10% is 10% of the containing block’s width. That surprise trips up many beginners.
margin Not the same as margin-bottom Padding is inside the border and does not collapse. Margin is outside and can collapse with adjacent vertical margins.
negative Negative padding is invalid Unlike some margin values, negative padding is not allowed. The declaration is ignored.
logical Does not follow writing mode For spacing that should stay “after” the content in any writing mode, use padding-block-end .
box box-sizing changes the total size With box-sizing: border-box , bottom padding is included in the element’s declared height.
Compatibility
Browser Support padding-bottom is a browser CSS property for the box model. Node.js, Deno, and Bun do not apply it.
✓ Baseline · Widely available
padding-bottom Supported in all modern browsers and Internet Explorer for many years. Part of the CSS Box Model.
Google Chrome 1+
Full support
Mozilla Firefox 1+
Full support
Apple Safari 1+
Full support
Microsoft Edge 12+
Full support
Opera 3.5+
Full support
Samsung Internet 1+
Full support
Internet Explorer 4+
Full support padding-bottom Widely supported
Bottom line: Safe for every layout. Logical longhands like padding-block-end are newer; classic padding-bottom is universal. It is not a runtime API.
Remember
Key Takeaways Role: physical bottom inner spacing between content and border.
Always bottom: writing mode does not remap this side.
Percent rule: percentages use containing-block width, not height.
Limits: no auto, no negatives; use logical longhands when writing mode may change.
One line: padding-bottom adds non-negative inner space on the physical bottom edge.
Frequently Asked Questions What does the CSS padding-bottom property do? It sets inner spacing on the physical bottom edge, between the content and the bottom border.
What is the default value of padding-bottom? The default is 0, so there is no bottom padding until you set one.
How is padding-bottom different from margin-bottom? padding-bottom is inside the border. margin-bottom is outside the border and can collapse with neighboring vertical margins.
How is padding-bottom different from padding-block-end? padding-bottom always means the physical bottom. padding-block-end follows writing mode and may map to another side in vertical text.
Can padding-bottom use percentages? Yes. Percentages resolve against the containing block width, even for bottom padding. Negative values are invalid.
Which browsers support padding-bottom? It is Baseline and supported in all modern browsers and Internet Explorer. It is a browser CSS property, not a Node.js feature.
About the author Developer, cloud engineer, and technical writer
I write practical tutorials so students and working developers can learn by doing—from databases and APIs to deployment on AWS.
8 people found this page helpful
Helpful Share Copy link Suggestion