繁体   English   中英

自动换行不适用于百分比宽度

[英]word-wrap is not working with the width in percentage

我想与width:48%彼此对齐。 如果文本中没有空格,则应将字符串断开。 因此,我添加了word-wrap:break-word

这行不通。 在Chrome中,如果我还添加word-break:break-word ,则可以正常工作。 在IE中,它将永远无法工作。

这是小提琴: http : //jsfiddle.net/e02k0d8e/

我必须添加什么到.GridRole才能在所有浏览器中正常工作? 我不想添加全部功能!

这种情况可以通过两种方式处理。

1)一些承租人在太空之后。

2)使用word-wrap:break-all

有两种方法。

解决方案1

-ms-word-break: break-all;
       word-break: break-all;

解决方案2

word-break: break-word;
   -webkit-hyphens: auto;
   -moz-hyphens: auto;
   -ms-hyphens: auto;
   hyphens: auto;

暂无
暂无

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

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