dShringi
dShringi

Reputation: 1497

Word-wrap not working in Internet Explorer

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 ?

Upvotes: 17

Views: 35047

Answers (7)

Anusha Medicherla
Anusha Medicherla

Reputation: 41

-ms-word-break: break-all;

works in > IE9

Upvotes: 3

DevOragz
DevOragz

Reputation: 131

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*/
}

Upvotes: 8

frodo2975
frodo2975

Reputation: 11725

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

Upvotes: 1

Piyush Marvaniya
Piyush Marvaniya

Reputation: 2542

try it this way

  .table tr td { 
               word-wrap: break-word;
               word-break: break-all;
               }

Upvotes: 9

mukesh
mukesh

Reputation: 151

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

Upvotes: 15

Jurijs Nesterovs
Jurijs Nesterovs

Reputation: 255

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

Upvotes: 0

btevfik
btevfik

Reputation: 3431

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/

Upvotes: 18

Related Questions