{hyphens} Property | CSS: Presentation Layer
Standards Based Development
The hyphens property provides intsructions to user agents for how to approach splitting up the words that make up the content to improve the layout of the text when line-wrapping. html language is determined by the lang attribute while user agents will hyphenate only if this attribute is present, and if there is an appropriate, correlating hyphenation dictionary available for the value of lang.
In xml the xml:lang attribute must be used.
hyphens Values
hyphens:none Value
The hyphens:none declaration tells user agents to not break words at line breaks, even if characters inside the words suggest line break points; lines will only wrap at whitespace.
hyphens:manual Value
The hyphens:manual declaration tells user agents to only break words for line-wrapping where characters inside the word suggest link break opportunities.
hyphens:auto Value
Suggesting Line Break Opportunities
2010 (hyphen) and 00AD (shy) are two unicode characters that can be utilized to manually specify potential line break points within text.
2010 (hyphen)
2010: the "hard" hyphen character indicates a visible line break opportunity. The hyphen will be rendered, even if the line is not actually broken at that point.
00AD (shy)
00AD (shy) is an invisible, "soft" hyphen; 00AD is not rendered visibly, rather, it suggest a location where the user agent might choose to break the word (if necessary).
Note: html allows for the use of ­ to insert a soft hyphen.
Barebones hyphens: css
/** http://meyerweb.com/eric/thoughts/2012/12/17/where-to-avoid-css-hyphenation/ **/
body{hyphens:auto}
code,var,kbd,samp,tt,dir,listing,plaintext,xmp,abbr,acronym,blockquote,q{hyphens:none}
Languages Support Notes
| Language | Firefox | ie |
|---|---|---|
| Afrikaans (af) | 8.0 | |
| Bulgarian (bg) | 8.0 | |
| Catalan (ca) | 8.0 | 10.0 |
| Czech | 10.0 | |
| Swiss German, Traditional Orthography (de-CH) | 8.0 | |
| Danish (da) | 8.0 | 10.0 |
| Dutch (nl) | 8.0 | 10.0 |
| English (en) | ?? | 10.0 |
| English, United States (en-US) | 6.0 | 10.0 |
| Esperanto (eo) | 8.0 | |
| Estonian (et) | 8.0 | |
| Finnish (fi) | 8.0 | |
| French (fr) | 8.0 | 10.0 |
| Galician (gl) | 9.0 | |
| German, Traditional Orthography (de-1901) | 8.0 | ?? |
| German, Reformed Orthography (de-1996) | 8.0 | 10.0 |
| Hungarian (hu) | 9.0 | |
| Icelandic (is) | 8.0 | |
| Interlingua (ia) | 8.0 | |
| Italian (it) | 9.0 | 10.0 |
| Kurmanji (kmr) | 8.0 | |
| Latin (la) | 8.0 | |
| Lithuanian (lt) | 8.0 | |
| Mongolian (mn) | 8.0 | |
| Norwegian Bokmål (nb) | 8.0 | 10.0 |
| Norwegian Nynorsk (nn) | 8.0 | 10.0 |
| Polish | 10.0 | |
| Portuguese (pt) | 8.0 | 10.0 |
| Brazilian Portuguese | 10.0 | |
| Russian (ru) | 8.0 | 10.0 |
| Serbo-Croatian (sh) | 8.0 | |
| Slovenian (sl) | 8.0 | |
| Spanish (es) | 8.0 | 10.0 |
| Swedish (sv) | 8.0 | 10.0 |
| Turkish (tr) | 9.0 | 10.0 |
| Ukrainian (uk) | 9.0 | |
| Upper Sorbian (hsb) | 8.0 | |
| Welsh (cy) | 8.0 |