Yesterday I found that proper hyphenation of text is now supported by Firefox, IE10, and Safari. So I added it to my main style sheet and it should work in these browsers across my site. I also advise you to add it to your sites straight away.
-webkit-hyphens: auto; -moz-hyphens: auto; -ms-hyphens: auto; -o-hyphens: auto; hyphens: auto;
So far it’s prefixed, and Opera and Chrome don’t support it, but we will be future-friendly and include all variants of this declaration, won’t we?
Hyphenation is cool to have, but nobody will notice its absence, because we’ve lived without it for so long. So we just add the proper declarations and compliant browsers will pick it up.
This is how progressive enhancement should work. Add advanced feature X to site, and if it doesn’t work there’s not really a problem.
Right now I see only two problems with the use of
langattribute. Use the simplest solution and declare it on the
<html lang="en">I noticed that this attribute does not work on a
p: no browser picks up the language. It works fine on a
div, though. So if a certain section of a page is in a different language, add the
langattribute to something above a
pand test hyphenation properly.
That’s it. It works. Great, isn’t it?
Upcoming speaking gigs: