The hanging-punctuation property lets punctuation marks hang outside the text box so lines of body text align more cleanly.
01
Punctuation
Quote marks.
02
none
Default.
03
first
Opening mark.
04
last
Closing mark.
05
Typography
Clean edges.
06
Support
Limited.
Fundamentals
Introduction
The hanging-punctuation property in CSS allows you to control the positioning of punctuation marks in relation to the surrounding text. This property is particularly useful for creating typographic effects, such as when you want punctuation marks to hang outside of the main text block for a cleaner, more visually appealing layout.
Definition and Usage
Apply hanging-punctuation on block-level text containers such as paragraphs, blockquotes, or articles. It works best with narrow columns and quoted text where opening or closing marks would otherwise push body text inward.
💡
Beginner Tip
Browser support for this property is limited. Treat it as a progressive enhancement for typography, not a requirement for readable layout.
Foundation
📝 Syntax
The syntax for the hanging-punctuation property is as follows:
syntax.css
element{hanging-punctuation:value;}
The value can be one or more of the keywords below, separated by spaces:
none
first
last
first last
allow-end
allow-start
Basic Example
hanging-punctuation-basic.css
p{width:200px;hanging-punctuation:first;}
hanging-punctuation: none;hanging-punctuation: first;hanging-punctuation: first last;
Default Value
The default value of the hanging-punctuation property is none, which means that no special hanging behavior is applied to punctuation marks.
Syntax Rules
Applies to block containers that hold text.
Accepts keyword values and combinations like first last.
The property is inherited.
Works best with narrow widths and punctuation-heavy content.
Support varies by browser; test before relying on it in production.
Cheat Sheet
⚡ Quick Reference
Question
Answer
Initial value
none
Applies to
Block containers
Inherited
Yes
Controls
Punctuation placement at line edges
Browser support
Limited (best in Safari)
Reference
💎 Property Values
Value
Description
none
No hanging punctuation is applied. Punctuation marks stay in their normal position.
first
The punctuation mark at the beginning of a line hangs outside the block
last
The punctuation mark at the end of a line hangs outside the block
first last
Both opening and closing punctuation at line edges may hang outside the block
allow-end
Allows end punctuation to hang outside when it improves visual alignment
allow-start
Allows start punctuation to hang outside when it improves visual alignment
Preview
👀 Live Preview
A narrow paragraph with hanging-punctuation: first (effect visible in supporting browsers):
“Hello there!” This paragraph demonstrates how hanging punctuation can improve quote alignment in narrow columns.
Hands-On
Examples Gallery
Hang opening quotes with first, closing marks with last, combine both, and compare against the default none value.
🔢 Hanging Punctuation
Start with the reference example — opening punctuation hanging outside the text block.
Example 1 — Hang Opening Punctuation
Make the opening quotation mark at the start of a line hang outside the text box.
With none, punctuation stays inside the content box. With first, the opening mark can extend left for cleaner alignment.
A11y
♿ Accessibility
Do not rely on hanging punctuation for meaning — the text must remain readable without the visual effect.
Keep sufficient line length so quoted passages remain easy to read.
Test with screen readers — punctuation is still announced normally in supporting browsers.
Provide fallbacks since unsupported browsers ignore the property safely.
Maintain contrast between text, punctuation, and background.
🧠 How hanging-punctuation Works
1
Text reaches a line edge
A line starts or ends with a punctuation mark such as a quote or period.
Line break
2
hanging-punctuation is set
Keywords like first or last tell the browser which marks may hang.
CSS rule
3
Browser adjusts placement
In supporting browsers, punctuation can render outside the content box edge.
Rendering
=
“
Cleaner text alignment
Body text lines up evenly even when quotes appear at the edges.
Compatibility
🖥 Browser Compatibility
The hanging-punctuation property has limited browser support. It is most reliable in Safari and other WebKit-based browsers. Chrome, Firefox, and Edge may not apply the effect.
⚠ Limited · Progressive enhancement
Check before you rely on it
Treat hanging punctuation as an optional typography enhancement, not a layout requirement.
28%Modern browser support
Apple Safari10+ · macOS & iOS
Full support
Google ChromeDesktop & Mobile
Not supported
Mozilla FirefoxDesktop & Mobile
Not supported
Microsoft EdgeChromium
Not supported
OperaChromium-based
Not supported
hanging-punctuation property28% supported
Bottom line: Use as progressive enhancement. Text remains readable when the property is ignored.
Wrap Up
🎉 Conclusion
The hanging-punctuation property offers a useful way to enhance typographic aesthetics by controlling the placement of punctuation marks. By experimenting with different values, you can achieve visual effects that contribute to a more polished and professional look for your text content.
Because browser support is limited, use it as an enhancement rather than a core layout technique. Start with first on narrow quoted paragraphs and test in Safari and other target browsers.