简体   繁体   English

word-wrap:break-all无法在IE中按预期方式工作

[英]word-wrap:break-all not working as expected in IE

Currently i am having issue the the word-wrap:break-all; 目前,我正在发布word-wrap:break-all;一词。 in IE 11 ,IE 9 (tested) . 在IE 11,IE 9中(已测试)。 word-wrap:break-all is working fine if paragraph contains lengthy words as in example http://jsfiddle.net/Midhun52/Jb26N/ . 如果段落中包含冗长的单词,则word-wrap:break-all效果很好,例如示例http://jsfiddle.net/Midhun52/Jb26N/

<table style="width:40px" class="t">
    <tr>
        <td> </td>
        <td class="r">
            <div style="width:100%">
            <p>abcd abcd yyyyyyyyyyyyyyyyyyyyyyyyyy abcd
               </p>
            </div>

        </td>
    </tr>

</table>

But if the lengthy word is made up of characters such as ''' ,':' etc word-wrap:break-all is not working as in example http://jsfiddle.net/Midhun52/3Jyt4/ . 但是,如果冗长的单词由诸如''',':'等字符组成,则word-wrap:break-all不能像示例http://jsfiddle.net/Midhun52/3Jyt4/那样工作。

<table style="width:40px" class="t">
        <tr>
            <td> </td>
            <td class="r">
                <div style="width:100%">
                <p>abcd abcd yyyyyyyyyyyyyyyyyyyyyyyyyy ''''''''''''''''''''''''''''''''''''''''''''''abcd
                   </p>
                </div>

            </td>
        </tr>

    </table>

Please let me know what's the reason behind this? 请让我知道背后的原因是什么? Any solution to this problem? 这个问题有什么解决办法吗?

我认为这是因为(根据w3cbreak-all属性只应打破字母或数字。

If you really want a string like '''''''''''''''''''''''''''''''''''''''''''''' to be breakable at any point, you need to insert (somehow, perhaps with JavaScript) a line break opportunity between any two characters there. 如果您真的想要像''''''''''''''''''''''''''''''''''''''''''''''这样的字符串''''''''''''''''''''''''''''''''''''''''''''''是易碎的,在任何时候,你需要插入(不知怎么的,也许是使用JavaScript)的任何两个字符之间有一个换行。 This could be <wbr> or &#x200b; 这可能是<wbr>&#x200b; . Under normal conditions, a string of special characters may have some permissible break points. 在正常情况下,一串特殊字符可能会有一些允许的断点。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM