The padding-block property is a logical CSS shorthand for inner spacing on the block-start and block-end sides of an element. In normal horizontal English layouts, that usually means the top and bottom padding.
The padding-block property in CSS is a shorthand property that sets the padding area on the block start and block end sides of an element. In languages written horizontally, such as English, these correspond to the top and bottom padding.
This property is part of the CSS Logical Properties and Values specification, which provides a way to define properties in a writing-mode-independent manner.
Definition and Usage
Apply padding-block when you need vertical inner spacing that follows the block axis instead of fixed physical top and bottom edges. Use a single value for equal block-start and block-end padding, or two values when each side needs a different amount.
Like regular padding, padding-block 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
For a simple horizontal page, padding-block: 20px 40px; looks like 20px top padding and 40px bottom padding. The advantage appears when writing mode changes and physical top/bottom rules would no longer be correct.
Horizontal writing → top and bottomVertical writing → left and right
Foundation
📝 Syntax
The syntax for the padding-block property allows you to specify one or two values:
syntax.css
element{padding-block:value;}
One value — The same padding is applied to both the block start and block end.
Two values — The first value is applied to the block start, and the second value is applied to the block end.
Sections, cards, text blocks, and writing-mode-aware vertical spacing
Defaults
🎯 Default Value
The default value of the padding-block property is 0, meaning no padding is applied.
Reference
💎 Property Values
Value
Example
Description
Length
padding-block: 20px 40px;
A specific length value, such as 10px, 1em, 2rem, etc.
Percentage
padding-block: 5%;
A percentage of the containing block’s inline size, such as 10%.
auto
—
Not applicable.
initial
padding-block: initial;
Sets the property to its default value.
inherit
padding-block: inherit;
Inherits the property value from its parent element.
padding-block: 24px;padding-block: 20px 40px;padding-block-start: 1rem;
Preview
👀 Live Preview
Four boxes with the same content and different pblk- utility classes showing increasing block-axis inner spacing:
pblk-sm
pblk-md
pblk-lg
pblk-xl
Hands-On
Examples Gallery
Try the reference example with two values, a single-value form, section vertical spacing, and a logical vs physical padding comparison.
🔢 Basic padding-block
Start with the reference example — different padding on block-start and block-end.
Example 1 — Block-Start and Block-End Padding
In this example, we’ll add padding to the block start and block end sides of a <div> element.
padding-block-example.html
<style>.example{padding-block:20px40px;background-color:lightblue;}</style><divclass="example">
This div has 20px padding at the block start and 40px at the block end.
</div>
This div has 20px padding at the block start and 40px at the block end.
How It Works
The lightblue background fills the padding area, so you can see 20px space at block-start and 40px at block-end. In horizontal English, that is top and bottom padding.
Example 2 — Single Value
Set equal block-start and block-end padding with padding-block: 24px.
padding-block adds vertical breathing room inside this card.
How It Works
Pair padding-block for vertical rhythm with padding-inline for horizontal rhythm. Together they replace physical padding shorthand in logical layouts.
Example 4 — Logical vs Physical Padding
Compare padding-block with padding-top and padding-bottom.
padding-block-logical.css
/* Logical — follows writing mode */.logical{padding-block:16px32px;}/* Physical — fixed to top and bottom */.physical{padding-top:16px;padding-bottom:32px;}
In horizontal English, both approaches look the same. padding-block stays correct when writing mode changes; physical top and bottom padding does not.
Companion
padding-block vs padding, padding-inline & side properties
The padding shorthand sets all four sides at once using physical edges. Use padding for simple layouts that always use horizontal writing.
padding-inline controls inline-start and inline-end padding (usually left and right in English). When you need per-edge block-axis control, use padding-block-start, padding-block-end, or the longhand pair padding-top and padding-bottom.
Improve readability — Text blocks benefit from block-axis padding so lines do not touch container edges.
Size touch targets — Pair block padding with inline padding on buttons and links for comfortable tap areas.
Respect writing modes — Logical padding keeps spacing correct for users of vertical or RTL layouts.
Do not hide content — Very large block padding on small screens can push important content out of view.
Test zoomed layouts — Users who zoom in rely on comfortable padding to keep text readable.
🧠 How padding-block Works
1
The browser finds block-start and block-end
Writing mode decides which physical edges are block-start and block-end.
Writing mode
2
You set one or two padding values
Write padding-block: 20px 40px; or a single value for both sides.
CSS rule
3
Browser adds space on block sides
Padding is inserted between the content edge and the border on block-start and block-end.
Box model
=
▦
Adaptable block-axis spacing
Your layout keeps correct vertical spacing when writing mode changes.
Compatibility
Browser Compatibility
The padding-block property is supported in most modern browsers, including the latest versions of Chrome, Firefox, Safari, Edge, and Opera. However, it is always advisable to test your website across different browsers to ensure compatibility, especially if your audience includes users of older browsers.
✓ Baseline · Modern browsers
Logical padding in today’s browsers
Chrome, Firefox, Safari, Edge, and Opera support padding-block in current versions.
96%Modern browser support
Google Chrome69+ · Desktop & Mobile
Full support
Mozilla Firefox41+ · Desktop & Mobile
Full support
Apple Safari12.1+ · macOS & iOS
Full support
Microsoft Edge79+ · Chromium
Full support
Opera56+ · Modern versions
Full support
padding-block property96% supported
Bottom line: Use padding-block confidently in modern projects. For older browsers, fall back to padding-top and padding-bottom.
Wrap Up
Conclusion
The padding-block property provides a convenient way to control the padding on the block start and block end sides of an element, respecting the writing mode of the document.
This property helps create more flexible and responsive designs by adjusting the layout based on the writing direction. Experiment with different padding values to see how they can enhance the visual structure of your web content.
Use padding-block for vertical rhythm in logical layouts
Pair with padding-inline for full logical spacing
Prefer rem or em for scalable block-axis spacing
Use two values when block-start and block-end need different amounts
Test in vertical writing mode for international layouts
❌ Don’t
Confuse padding-block with margin-block
Assume padding-block always means top and bottom in every writing mode
Forget that percentage padding is based on inline size
Mix logical and physical padding on the same element without reason
Skip fallbacks when supporting very old browsers
Summary
Key Takeaways
Knowledge Unlocked
Five things to remember about padding-block
Use these points when spacing content along the block axis.
5
Core concepts
↕01
Block Axis
Start and end sides.
Purpose
002
Default 0
No spacing.
Default
1|203
Shorthand
One or two values.
Syntax
%04
Units
px, em, rem, %.
Values
wm05
Writing mode
Adapts logically.
Logical CSS
❓ Frequently Asked Questions
The padding-block property is a shorthand that sets padding on the block-start and block-end sides of an element. In horizontal writing, those are usually the top and bottom padding.
The default value is 0, meaning no block-axis inner spacing is applied unless you set padding-block explicitly.
padding-top and padding-bottom always target physical top and bottom edges. padding-block follows the writing mode, so it stays correct when text direction or writing mode changes.
Yes. With two values, the first applies to block-start and the second to block-end. With one value, both sides use the same padding.
Use padding-block when building layouts that may use vertical writing modes, multilingual content, or logical CSS systems that pair with properties like inline-size and block-size.