Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

WebKit Hyphenation

Has anyone successfully been able to implement hyphenation in any of the WebKit browsers? I've tried the CSS3 hyphenation style as well as -webkit-hyphens: auto. No dice for either of those. Or maybe I'm doing something wrong?

Note: I've only tried Safari and Chrome on a Mac.

Update: Code example

<html>
  <head>
    <style>
      div {
        -webkit-hyphens: auto;
      }
    </style>
  </head>
  <body>
     <div style="width: 150px; border: solid 1px black;">
       <p>Anaideia, spirit of ruthlessness, shamelessness, and unforgivingness</p>
       <p>Supercalifragilisticexpialidocious, Antidisestablishmentarianism, Floccinaucinihilipilification, Hippopotomonstrosesquipedaliophobia</p>
     </div>
  </body>
</html>
like image 601
dandax Avatar asked Mar 18 '11 19:03

dandax


People also ask

How do you hyphenate text in CSS?

There are two Unicode characters used to manually specify potential line break points within text: U+2010 (HYPHEN) The "hard" hyphen character indicates a visible line break opportunity. Even if the line is not actually broken at that point, the hyphen is still rendered.

Can I use CSS hyphens?

By default, CSS sets no limit to the number of consecutive hyphens, but you can use the hyphenate-limit-lines property to specify a maximum. Currently this is only supported by IE/Edge and Safari (with prefixes).

How do you break hyphenated words in CSS?

hyphens: manual Words are only broken at line breaks where there are characters inside the word that suggest line break opportunities. There are two characters that suggest line break opportunity: U+2010 (HYPHEN): the “hard” hyphen character indicates a visible line break opportunity.

How do you turn on hyphenation?

Hyphenate text automaticallyOn the Tools menu, click Hyphenation. Select the Automatically hyphenate document check box. In the Hyphenation zone box, enter the amount of space to leave between the end of the last word in a line and the right margin.


1 Answers

-webkit-hyphens works fine on iOS 4.2 and above, and is partially supported in the webkit nightlies.

Webkit:

Webkit

iOS 4.3:

iOS 4.3

like image 164
Rich Bradshaw Avatar answered Sep 25 '22 23:09

Rich Bradshaw