Home CSS Properties hanging-punctuation CSS hanging-punctuation Property Definition
Definition and Usage The hanging-punctuation property controls whether punctuation may hang outside the line box at the start or end of a line. That keeps the main letters aligned while quotes or stops sit slightly outside the edge.
It applies to all elements, is inherited, and starts at none. You can combine keywords such as first last or first allow-end.
Limited availability. Not Baseline. Works in Safari (and Safari on iOS). Chrome, Edge, and Firefox generally ignore it. Safe as progressive enhancement — unsupported browsers keep normal punctuation.
Syntax
CSS Syntax hanging-punctuation: none | first || last || allow-end | force-end | initial | inherit ;
You may use one, two, or three keywords together (for example first last). allow-end and force-end cannot both be used.
Values
Property Values Value Description Try it noneDefault. No character hangs Try itfirstOpening bracket or quote at the start of the first line hangs Try itlastClosing bracket or quote at the end of the last line hangs Try itfirst lastCombine start and end hanging Try itallow-endStop or comma may hang at the end of a line if it does not fit Try itinheritTakes the parent’s hanging-punctuation Try it
force-end forces a stop or comma to hang even when it would fit. Prefer allow-end for softer behavior.
Approach
How to Use hanging-punctuation Use it on quoted text when you want optical alignment of the first letters.
Wrap quoted copy in a block such as <p> or <blockquote>. Start the text with an opening quote or bracket if you use first. Set hanging-punctuation: first, last, or both. Check in Safari. Other browsers keep the punctuation inside the box. Piece Required? Role Text with punctuation Yes Opening/closing quotes, brackets, or end stops hanging-punctuation keywordYes first, last, allow-end, and combinationsSupporting browser To see the effect Safari today; others ignore the property
Try it
Live Preview Toggle hanging on a quoted paragraph. In Safari, the opening « can sit outside the border. Elsewhere, the text still looks fine.
Code
CSS Examples Each snippet focuses on hanging-punctuation. Test in Safari to see hanging. Use Try It Yourself for a live editor.
1. First 2. First + last 3. None Example 1 — Hang the Opening Quote Let the opening punctuation sit outside the first line.
<style>
p {
hanging-punctuation: first;
}
</style>
<p>«Hello from hanging punctuation.»</p> «Hello from hanging punctuation.»
How It Works Start with a quote. The first character is an opening mark («).Set first. hanging-punctuation: first asks that mark to hang outside the line box.Letters align. The main text edge looks cleaner beside nearby paragraphs.Safari shows it. Other browsers keep the quote inside — still readable.Example 2 — Hang Both Ends Combine first and last for opening and closing marks.
<style>
p {
hanging-punctuation: first last;
}
</style>
<p>«Quoted line with both ends.»</p> «Quoted line with both ends.»
How It Works Use two keywords. Space-separated first last enables both behaviors.Opening hangs. The first-line opening mark can leave the box.Closing hangs. The last-line closing mark can leave the box.Still optional. Unsupported browsers ignore the property safely.Example 3 — No Hanging Keep punctuation fully inside the text box.
<style>
p {
hanging-punctuation: none;
}
</style>
<p>«Default: punctuation stays inside.»</p> «Default: punctuation stays inside.»
How It Works Use none. This is the initial value.Quotes stay inside. Opening and closing marks remain within the line box.Predictable everywhere. Same look in Safari and Chromium.Good baseline. Turn hanging on only when you want the optical effect. Edge Cases & Pitfalls If nothing hangs, support or punctuation type is usually why.
support Limited browser support Chrome, Edge, and Firefox generally do not apply hanging-punctuation. Treat it as a Safari-friendly enhancement.
chars Only certain characters hang first / last target opening and closing brackets or quotes. allow-end targets stops and commas at line ends.
combine allow-end vs force-endUse one or the other, not both. allow-end hangs when needed; force-end forces hanging.
layout Hanging can need side room A tight parent with overflow: hidden may clip hanging marks. Leave a little padding outside the text edge.
align Pairs well with text-align Hanging is about optical edges. text-align still controls how lines are justified inside the box.
Compatibility
Browser Support hanging-punctuation is a browser typography property . Node.js, Deno, and Bun do not apply it.
✓ Limited availability
hanging-punctuation Safari 10+ (partial), stronger in Safari 17.4+. Chrome, Edge, and Firefox: not supported. Use as progressive enhancement.
18% Global reach (approx.)
Google Chrome No
None
Mozilla Firefox No
None
Apple Safari 10+ partial · 17.4+ stronger
Partial / Full
Microsoft Edge No
None
Opera No
None
Samsung Internet No
None
Internet Explorer No
None hanging-punctuation Safari-first
Bottom line: Safe to ship as enhancement: unsupported browsers ignore it. Do not rely on hanging for critical layout.
Remember
Key Takeaways Role: hang selected punctuation outside the line box for cleaner letter alignment.
Common values: none, first, last, allow-end (combinable).
Initial value: none. Inherited.
Support: Limited availability — Safari today; ignore elsewhere.
One line: hanging-punctuation pulls quotes outside the box so the text edge looks aligned — when the browser supports it.
Frequently Asked Questions What does the CSS hanging-punctuation property do? It lets certain punctuation marks hang outside the line box at the start or end of a line, so the main letters align more cleanly.
What is the default value of hanging-punctuation? The initial value is none. Punctuation stays inside the normal text box.
What is the difference between first and last? first hangs an opening bracket or quote at the start of the first line. last hangs a closing bracket or quote at the end of the last line.
What does allow-end do? allow-end lets a stop or comma hang at the end of a line when it would not otherwise fit before justification.
Is hanging-punctuation widely supported? No. It is Limited availability. Safari supports it; Chrome, Edge, and Firefox generally do not. Use it as progressive enhancement.
Which browsers support hanging-punctuation? Safari (partial from 10, fuller in recent versions) and Safari on iOS. It is a browser typography 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