CSS 'hyphens' description added#44363
Conversation
added a description. added text to the examples de-notified as the text is just part of the description now
|
Preview URLs (1 page) (comment last updated: 2026-06-09 18:33:32) |
chrisdavidmills
left a comment
There was a problem hiding this comment.
Looks great, @estelle. Just a few suggestions for you to mull over.
| > If you apply [`word-break: break-all`](/en-US/docs/Web/CSS/Reference/Properties/word-break#break-all) then no hyphens are shown, even if the word breaks at a hyphenation point. | ||
| The `hyphens` property can be used to define how words should be hyphenated when text wraps across multiple lines. It can prevent hyphenation entirely, hyphenate at manually-specified points within the text, or let the browser automatically insert hyphens where appropriate. | ||
|
|
||
| Hyphenation rules are language-specific. In HTML, the language is determined by the [`lang`](/en-US/docs/Web/HTML/Reference/Global_attributes/lang) attribute. Browsers will only hyphenate if this attribute is present and the appropriate hyphenation dictionary is available. The `auto` setting's behavior depends on the language being properly tagged to select the appropriate hyphenation rules. |
There was a problem hiding this comment.
| Hyphenation rules are language-specific. In HTML, the language is determined by the [`lang`](/en-US/docs/Web/HTML/Reference/Global_attributes/lang) attribute. Browsers will only hyphenate if this attribute is present and the appropriate hyphenation dictionary is available. The `auto` setting's behavior depends on the language being properly tagged to select the appropriate hyphenation rules. | |
| Hyphenation rules are language-specific. In HTML, the language is determined by the [`lang`](/en-US/docs/Web/HTML/Reference/Global_attributes/lang) attribute. Browsers will only hyphenate if this attribute is present and the appropriate hyphenation dictionary is available. The efficacy of `hyphens: auto` depends on the language being properly tagged to select the appropriate hyphenation rules. |
I thought it would be good to clarify what we mean by "auto", plus, really, we are talking about how effective it is, rather than some general behavior?
There was a problem hiding this comment.
i just moved the note down. I have to go down a rabbit hole now....
| In XML, the [`xml:lang`](/en-US/docs/Web/SVG/Reference/Attribute/xml:lang) attribute must be used. The specification does not define rules for how hyphenation is performed, so the exact hyphenation may vary from browser to browser. | ||
|
|
||
| ## Suggesting line break opportunities | ||
| The {{cssxref("hyphenate-character")}} property can be used to specify an alternative hyphenation character to use at the end of the line being broken. If you apply [`word-break: break-all`](/en-US/docs/Web/CSS/Reference/Properties/word-break#break-all) then no hyphens are shown, even if the word breaks at a hyphenation point. If you apply {{cssxref("text-wrap-mode","text-wrap-mode: nowrap")}}, no wrapping occurs so no hyphens will appear. |
There was a problem hiding this comment.
"the end of the line being broken" is ambiguous. Do you mean the end of a sentence, or the point where a sentence breaks across two lines? Would be good to clarify.
Co-authored-by: Chris Mills <chrisdavidmills@gmail.com>
chrisdavidmills
left a comment
There was a problem hiding this comment.
All looks good now, thanks, @estelle!


added a description.
added text to the examples
de-notified as the text is just part of the description now