hyphens
especifica como palavras devem ser hifenizadas quando o há quebra de texto em múltiplas linhas. Você pode prevenir a hifenização completamente, especificar pontos manualmente, ou permitir que o navegador insira automaticamente quando apropriado.hyphens: none; hyphens: manual; hyphens: auto; /* Valores globais */ hyphens: inherit; hyphens: initial; hyphens: unset;
Regras de hifenização são específicas para cada idioma. Em HTML, o idioma é determinado pelo atributo lang,
e os navegadores irão utilizar hífen apenas caso este atributo esteja presente e se houver um dicionário de hifenização disponível. Em XML, deve ser usado o atributo xml:lang.
Nota: As regras que definem como a hifenização é realizada não são explicitamente definidas pela especificação, então a hifenização exata pode variar de navegador para navegador.
Value not found in DB!
Sintaxe
A propriedade hyphens
é especificada como uma única palavra-chave escolhida da lista abaixo.
Valores
none
- Palavras não são separadas em quebras de linha, mesmo se seus caracteres sugiram pontos de quebra de linha. Linhas são quebradas apenas em espaços em branco.
manual
- Palavras são separadas apenas onde caracteres dentro de uma palavras sugiram oportunidades de quebra de linha. Veja abaixo Oportunidades sugeridas de quebra de linha para mais detalhes.
auto
- O navegador é livre para quebrar palavras automaticamente nos pontos apropriados de hifenização, seguindo quaisquer regras que ele escolher. Entretanto, oportunidades sugeridas de quebras de linha (veja Oportunidades sugeridas de quebra de linha abaixo) irão sobrepor a seleção automática de pontos de quebra quando presentes.
Nota: O comportamento da configuração auto
requer que a propriedade idioma seja indicada corretamente para que as regras de hifenização sejam selecionadas. Você deve especificar o idioma utilizando o atributo HTML lang
para garantir que a hifenização automática seja aplicada na linguagem de sua escolha.
Oportunidades sugeridas de quebra de linha
Existem dois caracteres Unicode que podem ser utilizados para especificar manualmente potenciais pontos de quebra de linha no texto:
- U+2010 (HYPHEN)
- O caractere hífen "duro" indica uma oportunidade de quebra de linha visível. Mesmo que não haja quebra de linha naquele ponto, o hífen ainda será renderizado.
- U+00AD (SHY)
- Um hífen invisivel, "suave". Este caractere não é renderizado visivelmente; ao invés, ele marca um local onde o browser deve quebrar a palavra se um hífen for necessário. Em HTML você pode usar
­
para inserir um hífen suave.
Sintaxe formal
Syntax not found in DB!
Exemplo
Este exemplo usa três classes, uma para cada configuração possível da propriedade hyphens
.
<ul> <li><code>none</code>: sem hífen; transbordar se necessário <p lang="en" class="none">An extreme­ly long English word</p> </li> <li><code>manual</code>: hífen apenas em &hyphen; ou &shy; (se necessário) <p lang="en" class="manual">An extreme­ly long English word</p> </li> <li><code>auto</code>: hífen onde o algorítmo decidir (se necessário) <p lang="en" class="auto">An extreme­ly long English word</p> </li> </ul>
p { width: 55px; border: 1px solid black; } p.none { -webkit-hyphens: none; -ms-hyphens: none; hyphens: none; } p.manual { -webkit-hyphens: manual; -ms-hyphens: manual; hyphens: manual; } p.auto { -webkit-hyphens: auto; -ms-hyphens: auto; hyphens: auto; }
Especificações
Especificação | Condição | Comentário |
---|---|---|
CSS Text Module Level 3 The definition of 'hyphens' in that specification. |
Rascunho atual | Initial definition |
Compatibilidade dos navegadores
Feature | Chrome | Firefox (Gecko) | Internet Explorer | Opera | Safari |
---|---|---|---|---|---|
Basic support | 13.0-webkit[1] 55.0 (unprefixed) |
10.0-ms[3] | 44 | 5.1-webkit | |
Hyphenation dictionary for Afrikaans (af, af-*) | ? | 8.0 (8.0) | Não suportado | ? | Não suportado |
Hyphenation dictionary for Bulgarian (bg, bg-*) | ? | 8.0 (8.0) | Não suportado | ? | Não suportado |
Hyphenation dictionary for Catalan (ca, ca-*) | ? | 8.0 (8.0) | 10.0 | ? | 9.1 |
Hyphenation dictionary for Croatian (hr, hr-*) | ? | 8.0 (8.0) | Não suportado | ? | 9.1 |
Hyphenation dictionary for Czech (cs, cs-*) | ? | Não suportado | 10.0 | ? | 9.1 |
Hyphenation dictionary for Danish (da, da-*) | ? | 8.0 (8.0) | 10.0 | ? | 9.1 |
Hyphenation dictionary for Dutch (nl, nl-*) | ? | 8.0 (8.0) | 10.0 | ? | 5.1 |
Hyphenation dictionary for English (en, en-*) | 55.0 (unprefixed) | 6.0 (6.0)[4] | 10.0 | 44 | 5.1[5] |
Hyphenation dictionary for Esperanto (eo, eo-*) | ? | 8.0 (8.0) | Não suportado | ? | Não suportado |
Hyphenation dictionary for Estonian (et, et-*) | ? | 8.0 (8.0) | Não suportado | ? | Não suportado |
Hyphenation dictionary for Finnish (fi, fi-*) | ? | 8.0 (8.0) | Não suportado | ? | 9.1 |
Hyphenation dictionary for French (fr, fr-*) | ? | 8.0 (8.0) | 10.0 | ? | 5.1 |
Hyphenation dictionary for Galician (gl, gl-*) | ? | 9.0 | Não suportado | ? | Não suportado |
Hyphenation dictionary for German, Traditional Orthography of 1901 (de-1901, de-AT-1901, de-DE-1901) | ? | 8.0 | ? | ? | ? |
Hyphenation dictionary for German, Reformed Orthography of 1996 (de, de-1996, de-DE, de-AT, de-*) | ? | 8.0 | 10.0 | ? | 5.1 |
Hyphenation dictionary for German, Swiss Orthography (de-CH, de-CH-*) | ? | 8.0 | ? | ? | ? |
Hyphenation dictionary for Hungarian (hu, hu-*) | ? | 9.0 | Não suportado | ? | 9.1 |
Hyphenation dictionary for Icelandic (is, is-*) | ? | 8.0 | Não suportado | ? | Não suportado |
Hyphenation dictionary for Interlingua (ia, ia-*) | ? | 8.0 | Não suportado | ? | Não suportado |
Hyphenation dictionary for Italian (it, it-*) | ? | 9.0 | 10.0 | ? | 5.1 |
Hyphenation dictionary for Kurmanji (kmr, kmr-*) | ? | 8.0 | Não suportado | ? | Não suportado |
Hyphenation dictionary for Latin (la, la-*) | (Yes) | 8.0 | Não suportado | 44 | Não suportado |
Hyphenation dictionary for Lithuanian (lt, lt-*) | ? | 8.0 | Não suportado | ? | Não suportado |
Hyphenation dictionary for Mongolian (mn, mn-*) | ? | 8.0 | Não suportado | ? | Não suportado |
Hyphenation dictionary for Norwegian (Bokmål) (no, no-*, nb, nb-*) | ? | 8.0 | 10.0 | ? | 9.1 |
Hyphenation dictionary for Norwegian (Nynorsk) (nn, nn-*) | ? | 8.0 | 10.0 | ? | Não suportado |
Hyphenation dictionary for Polish (pl, pl-*) | ? | 31.0 | 10.0 | ? | 9.1 |
Hyphenation dictionary for Portuguese (pt, pt-*) | ? | 8.0[6] | 10.0 | ? | 9.1 |
Hyphenation dictionary for Brazilian Portuguese (pt-BR) | ? | 8.0[6] | 10.0 | ? | Não suportado |
Hyphenation dictionary for Russian (ru, ru-*) | ? | 8.0 | 10.0 | ? | 5.1 |
Hyphenation dictionary for Serbian, Bosnian, Serbo-Croatian (sh, sh-*, sr, sr-*, bs, bs-*) | ? | 8.0 | Não suportado | ? | Não suportado |
Hyphenation dictionary for Slovenian (sl, sl-*) | ? | 8.0 | Não suportado | ? | Não suportado |
Hyphenation dictionary for Spanish (es, es-*) | ? | 8.0 | 10.0 | ? | 5.1 |
Hyphenation dictionary for Swedish (sv, sv-*) | ? | 8.0 | 10.0 | ? | 9.1 |
Hyphenation dictionary for Turkish (tr, tr-*) | ? | 9.0 | 10.0 | ? | 9.1 |
Hyphenation dictionary for Ukrainian (uk, uk-*) | ? | 9.0 | Não suportado | ? | 9.1 |
Hyphenation dictionary for Upper Sorbian (hsb, hsb-*) | ? | 8.0 | Não suportado | ? | Não suportado |
Hyphenation dictionary for Welsh (cy, cy-*) | ? | 8.0 | Não suportado | ? | Não suportado |
Hyphenation dictionary for other languages | ? | Não suportado | Não suportado | ? | Não suportado |
Feature | Android | Android Webview | Firefox Mobile (Gecko) | IE Mobile | Opera Mobile | Safari Mobile | Chrome for Android |
---|---|---|---|---|---|---|---|
Basic support | 4.0-webkit[1] | 55.0 (unprefixed) | 6.0 (6.0)-moz[2] 43.0 (43.0) |
Não suportado | 44 | 4.2-webkit | 55.0 (unprefixed) |
Hyphenation dictionary for Afrikaans (af, af-*) | ? | ? | ? | ? | ? | ? | ? |
Hyphenation dictionary for Bulgarian (bg, bg-*) | ? | ? | ? | ? | ? | ? | ? |
Hyphenation dictionary for Catalan (ca, ca-*) | ? | ? | ? | ? | ? | ? | ? |
Hyphenation dictionary for Croatian (hr, hr-*) | ? | ? | ? | ? | ? | ? | ? |
Hyphenation dictionary for Czech (cs, cs-*) | ? | ? | ? | ? | ? | ? | ? |
Hyphenation dictionary for Danish (da, da-*) | ? | ? | ? | ? | ? | ? | ? |
Hyphenation dictionary for Dutch (nl, nl-*) | ? | ? | ? | ? | ? | ? | ? |
Hyphenation dictionary for English (en, en-*) | ? | 55.0 (unprefixed) | ? | ? | 44 | ? | 55.0 (unprefixed) |
Hyphenation dictionary for Esperanto (eo, eo-*) | ? | ? | ? | ? | ? | ? | ? |
Hyphenation dictionary for Estonian (et, et-*) | ? | ? | ? | ? | ? | ? | ? |
Hyphenation dictionary for Finnish (fi, fi-*) | ? | ? | ? | ? | ? | ? | ? |
Hyphenation dictionary for French (fr, fr-*) | ? | ? | ? | ? | ? | ? | ? |
Hyphenation dictionary for Galician (gl, gl-*) | ? | ? | ? | ? | ? | ? | ? |
Hyphenation dictionary for German, Traditional Orthography of 1901 (de-1901, de-AT-1901, de-DE-1901) | ? | ? | ? | ? | ? | ? | ? |
Hyphenation dictionary for German, Reformed Orthography of 1996 (de, de-1996, de-DE, de-AT, de-*) | ? | ? | ? | ? | ? | ? | ? |
Hyphenation dictionary for German, Swiss Orthography (de-CH, de-CH-*) | ? | ? | ? | ? | ? | ? | ? |
Hyphenation dictionary for Hungarian (hu, hu-*) | ? | ? | ? | ? | ? | ? | ? |
Hyphenation dictionary for Icelandic (is, is-*) | ? | ? | ? | ? | ? | ? | ? |
Hyphenation dictionary for Interlingua (ia, ia-*) | ? | ? | ? | ? | ? | ? | ? |
Hyphenation dictionary for Italian (it, it-*) | ? | ? | ? | ? | ? | ? | ? |
Hyphenation dictionary for Kurmanji (kmr, kmr-*) | ? | ? | ? | ? | ? | ? | ? |
Hyphenation dictionary for Latin (la, la-*) | ? | (Yes) | ? | ? | 44 | ? | (Yes) |
Hyphenation dictionary for Lithuanian (lt, lt-*) | ? | ? | ? | ? | ? | ? | ? |
Hyphenation dictionary for Mongolian (mn, mn-*) | ? | ? | ? | ? | ? | ? | ? |
Hyphenation dictionary for Norwegian (Bokmål) (no, no-*, nb, nb-*) | ? | ? | ? | ? | ? | ? | ? |
Hyphenation dictionary for Norwegian (Nynorsk) (nn, nn-*) | ? | ? | ? | ? | ? | ? | ? |
Hyphenation dictionary for Polish (pl, pl-*) | ? | ? | ? | ? | ? | ? | ? |
Hyphenation dictionary for Portuguese (pt, pt-*) | ? | ? | ? | ? | ? | ? | ? |
Hyphenation dictionary for Brazilian Portuguese (pt-BR) | ? | ? | ? | ? | ? | ? | |
Hyphenation dictionary for Russian (ru, ru-*) | ? | ? | ? | ? | ? | ? | ? |
Hyphenation dictionary for Serbian, Bosnian, Serbo-Croatian (sh, sh-*, sr, sr-*, bs, bs-*) | ? | ? | ? | ? | ? | ? | ? |
Hyphenation dictionary for Slovenian (sl, sl-*) | ? | ? | ? | ? | ? | ? | ? |
Hyphenation dictionary for Spanish (es, es-*) | ? | ? | ? | ? | ? | ? | ? |
Hyphenation dictionary for Swedish (sv, sv-*) | ? | ? | ? | ? | ? | ? | ? |
Hyphenation dictionary for Turkish (tr, tr-*) | ? | ? | ? | ? | ? | ? | ? |
Hyphenation dictionary for Ukrainian (uk, uk-*) | ? | ? | ? | ? | ? | ? | ? |
Hyphenation dictionary for Upper Sorbian (hsb, hsb-*) | ? | ? | ? | ? | ? | ? | ? |
Hyphenation dictionary for Welsh (cy, cy-*) | ? | ? | ? | ? | ? | ? | ? |
Hyphenation dictionary for other languages | ? | ? | ? | ? | ? | ? | ? |
[1] Sem hifenização automática, apenas -webkit-hyphens: none
é suportado.
[2] Hifenização automática funciona apenas para idiomas cujos dicionários de hifenização sejam integrados com Gecko. Veja a nota abaixo para ver a lista completa destas linguagens.
[3] Hifenização automática funciona apenas para idiomas cujos dicionários de hifenização sejam integrados com Internet Explorer. Veja a nota abaixo para ver a lista completa destas linguagens.
[4] Usa um dicionário en-US.
[5] en-GB e en-US usam dicionários diferentes.
[6] Usa um dicionário Português.