Word-wrap not working in Internet Explorer
Asked Answered
I

7

17

When I'm using word-wrap:break-word with Browser Mode: IE9 Compatibility View and Document Mode: IE7 standards its working perfectly fine. However when I change the Document Mode: IE9 standards, its not working. I've also tried using -ms-word-wrap:break-word however its giving me the same result.

Document Type Definition: DTD/xhtml1-transitional.dtd

Can anyone tell me why is it so and if there is any workaround to cope up with it ?

Insult answered 19/4, 2013 at 6:45 Comment(7)
Markup? CSS? You're giving us nothing here.Entrance
Sounds familiar. Might try some of these ideas: #8395185 #13904090Superelevation
Put it in your question.Entrance
@Superelevation didn't worked !Insult
Create a jsfiddle with an example of your code to see what you have done. Only giving us the doctype is not helping us to help you.Aspia
@Aspia Checkout the jsFiddle here.Insult
Use word-wrap: break-word; supported in IE11 and Chrome.Touching
R
18

you need to have

table {
    width:100%;
    table-layout:fixed;
}

and put word-wrap in table,td,th not into span

http://jsfiddle.net/d6VsD/7/

Richelle answered 19/4, 2013 at 8:43 Comment(0)
P
15

applying word-wrap property to parent of the concerned element will resolved the problem in IE9.

Patriciapatrician answered 5/8, 2013 at 12:9 Comment(0)
N
9

try it this way

  .table tr td { 
               word-wrap: break-word;
               word-break: break-all;
               }
Nuclear answered 29/11, 2013 at 6:52 Comment(0)
C
8

In my case, IE did not respect the word break style until I made the span render as inline-block.

.selector{
    display: inline-block;
    word-break: break-all;
    overflow-wrap: break-word; /* For other browsers*/
}
Carding answered 17/10, 2016 at 17:56 Comment(0)
S
3
-ms-word-break: break-all;

works in > IE9

Strick answered 7/7, 2017 at 18:22 Comment(0)
C
1

Adding -ms-word-break: break-word; worked for me.

Crepitate answered 10/8, 2015 at 16:7 Comment(0)
D
0

it should work, .your_class_name{word-break:break-word;}, i have tested it in ie7 - ie9 and it breaks the word...

Drennan answered 19/4, 2013 at 9:11 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.