FireFox word breaks OK with css, but one letter at a time, not where hyphens are supposed to be???
NOT FireFox:
FireFox:
Here's the CSS:
.superLongStuff {
/*
SUPER LOOOOOOOOOOOONG WORD STUFF ...
*/
/* These are technically the same, but use both */
overflow-wrap: break-word;
word-wrap: break-word;
-ms-word-break: break-all;
/* This is the dangerous one in WebKit, as it breaks things wherever */
word-break: break-all;
/* Instead use this non-standard one: */
word-break: break-word;
/* Adds a hyphen where the word breaks, if supported (No Blink) */
-ms-hyphens: auto;
-moz-hyphens: auto;
-webkit-hyphens: auto;
hyphens: auto;
}
a) Don't use
word-break
when you want to use hyphenation. It will simply always break the words.b) To be on the safe side, add a language attribute to the container (can be
html
,body
, or also the containingdiv
, like<div class="a" lang="en">
- see below.