Word-wrap not working in Internet Explorer

2019-04-04 10:44发布

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 ?

7条回答
可以哭但决不认输i
2楼-- · 2019-04-04 11:15

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*/
}
查看更多
神经病院院长
3楼-- · 2019-04-04 11:18

try it this way

  .table tr td { 
               word-wrap: break-word;
               word-break: break-all;
               }
查看更多
小情绪 Triste *
4楼-- · 2019-04-04 11:22

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

查看更多
甜甜的少女心
5楼-- · 2019-04-04 11:23

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

查看更多
可以哭但决不认输i
6楼-- · 2019-04-04 11:26

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/

查看更多
Evening l夕情丶
7楼-- · 2019-04-04 11:37
-ms-word-break: break-all;

works in > IE9

查看更多
登录 后发表回答