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

前端 未结 9 1642
清酒与你
清酒与你 2021-01-07 17:23
9条回答
  •  孤街浪徒
    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.

提交回复
热议问题