MultiformeIngegno
MultiformeIngegno

Reputation: 7059

CSS3 hyphens not applied

I'm trying to add automatic CSS3 hyphens to my articles. Problem is the tag doesn't seem to affect the text.

I set

.entry p {
  -webkit-hyphens: auto;
     -moz-hyphens: auto;
          hyphens: auto;
}

... but nothing happens.

Here's an example page I'm talking about (BTW you won't see the above CSS in real site, but I tried with Firebug).

Upvotes: 2

Views: 1111

Answers (2)

randak
randak

Reputation: 2001

The issue in this case is a missing lang attribute. Without that defined, the web browsers do no know how to hyphenate the page, because they don't know what language they are hyphenating in.

Adding this attribute will fix the issue in browsers that support hyphenation.

Upvotes: 2

DOK
DOK

Reputation: 32841

You didn't mention which browser you are using.

According to this article, Chrome and Android browser actually support -webkit-hyphens: none, which is the default value, but none of the other values.

And, in Firefox and Internet Explorer, automatic hyphenation only works for some languages (defined with the lang attribute).

Edit: Here is the Mozilla page, which says "This is an experimental technology".

Upvotes: 0

Related Questions