Unable to get words to simply wrap without breaking

38 views Asked by At

I'm having trouble with getting a long paragraph of words to wrap to the next line without them breaking at all, even with hyphens.

My code:

p {
     white-space: pre-wrap !important;
     word-wrap: normal !important;
     word-break: normal !important;
     overflow-wrap: normal !important;
}

On Chrome, the word wrap works fine. No hyphens, just beautiful word-wrap with WHOLE words. On Firefox and Edge, I get word-wrap with HYPHENS, cutting up words between two lines.

What am I doing wrong here?

2

There are 2 answers

3
Russell Daley On

I'm wondering if maybe you have other code thats conflicting with the p tags. because, what i'm finding is that your code:

white-space: pre-wrap;

is the only place your changing from the default, which by default words dont wrap.

Maybe provide us with some more of your code, if possible.

0
Jackson Hayes On

Dang it. Stupid answer:

hyphens: none; -webkit-hyphens: none;

I can't believe I didn't think of this earlier.