Word-break:break-word not working in Firefox 21
Asked Answered
W

3

6

I've added word-break:break-word to the comments on my site to start breaking up the words when they overflow the comment box, but it doesn't appear to be working in Firefox. I've done a JS fiddle of the setup and it does work. So something must be conflicting but I can't find it for the life of me.

JS Fiddle (working): http://jsfiddle.net/F6K99/6/

Live problem: http://bit.ly/13NcY5F

Whencesoever answered 17/6, 2013 at 8:47 Comment(2)
looks like there's a double semicolon there, maybe Firefox doesn't like it? d.pr/i/6IKoIndefectible
Why do you want to bre ak words inste ad of proper word division?Roux
A
10

You can achieve this by the following:

A. Use word-break:break-all; instead of word-break:break-word;

WORKING SOLUTION

B. Or, Use word-wrap: break-word; instead of word-break:break-word;

WORKING SOLUTION

As far as I know, word-break does not have break-word attribute.

Hope this Helps.

Abigael answered 17/6, 2013 at 8:50 Comment(2)
Chrome supports "word-break: break-word;" which is different from "word-break:break-all;". It's more intelligent and will break inside of a word only if a break between words is not possible.Atropos
@Atropos - Can you produce a fiddle demonstrating what you have mentioned?Abigael
I
3

You have to use the following CSS.

word-break:normal;
word-wrap:normal;

This will work for both Chrome, Firefox.

Idealistic answered 29/4, 2015 at 12:54 Comment(2)
This doesn't answer the question, which is about breaking within words if they are longer than the container itself. Normal word wrapping/breaking merely breaks between words.Azalea
This solution worked for me, should be accepted answerFionafionna
D
1

u hv to use word-break:break-all;..it should work after that.

Dividend answered 17/6, 2013 at 8:57 Comment(1)
#17144114Abigael

© 2022 - 2024 — McMap. All rights reserved.