CSS word-wrap: break-word don't work on IE9

前端 未结 9 1626
清酒与你
清酒与你 2021-01-07 17:23
相关标签:
9条回答
  • 2021-01-07 18:05

    I remove the anchor tag after .tab_title class and it works

    0 讨论(0)
  • 2021-01-07 18:09

    For me it worked in both Chrome and IE with:

    .word-hyphen-break {
      word-break: break-word;
      word-wrap: break-word;
      width: 100%;
    }
    

    like this no need to configure specific width.

    0 讨论(0)
  • 2021-01-07 18:16

    This might do the trick: http://www.last-child.com/word-wrapping-for-internet-explorer/

    Another post also suggests applying word-break:break-all and word-wrap:break-word to it.

    0 讨论(0)
  • 2021-01-07 18:16

    i just figured out that word-wrap:break-word works only partially in IE8 and IE9. If I have a string of words with spaces, then that string gets wrapped. But if my string consists of one long word, it forces the parent/container element to expand according to its width

    0 讨论(0)
  • 2021-01-07 18:17

    I have had good success in Chrome, Firefox and IE with using:

    word-break: break-word;
    word-wrap: break-word;
    

    In my problem case I was using:

    display: table-cell;
    

    and I ended up having to include

    max-width: 440px;
    

    to get wrapping in all browsers. In most cases the max-width was not necessary. Using

    word-break: break-all;
    

    does not work well in IE because although long words without spaces will be wrapped, short words also stop wrapping at spaces.

    0 讨论(0)
  • 2021-01-07 18:19

    For a similar issue, I used display: inline-block on the <a> tag, which seems to help. And word-break: break-all as I was concerned with long URLs not wrapping.

    So, this in your case essentially...

    .tab_title a {
        display: inline-block;
        word-break: break-all;
    } 
    
    0 讨论(0)
提交回复
热议问题