Word-wrap not working in Internet Explorer

自古美人都是妖i 提交于 2019-12-21 07:07:19

问题


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 ?


回答1:


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/




回答2:


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




回答3:


try it this way

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



回答4:


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



回答5:


-ms-word-break: break-all;

works in > IE9




回答6:


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




回答7:


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



来源:https://stackoverflow.com/questions/16098785/word-wrap-not-working-in-internet-explorer

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!