你不知道的word-break属性的值;
word-break这个属性是用来防止文本溢出的,我们最常用的属性值:normal、break-all、keep-all;这三个大家都很熟悉了,我就不细说了,今天我讲讲一个不常用的属性值:break-word。来看个例子:
见图一图二(这里只比较break-all、break-word);
是不是感觉没有任何区别,是的,没错,你答对了,是没有区别
。but,重点来了如果输入的是字符,那么问题来了,见图三图四。
这是为什么呐?我们看下break-all和break-word代表的含义。
break-all:To prevent overflow, word breaks should be inserted between any two characters.
break-word:To prevent overflow, normally unbreakable words may be broken at arbitrary points if there are no otherwise acceptable break points in the line.
你get到了吗

word-break这个属性是用来防止文本溢出的,我们最常用的属性值:normal、break-all、keep-all;这三个大家都很熟悉了,我就不细说了,今天我讲讲一个不常用的属性值:break-word。来看个例子:
见图一图二(这里只比较break-all、break-word);
是不是感觉没有任何区别,是的,没错,你答对了,是没有区别
这是为什么呐?我们看下break-all和break-word代表的含义。
break-all:To prevent overflow, word breaks should be inserted between any two characters.
break-word:To prevent overflow, normally unbreakable words may be broken at arbitrary points if there are no otherwise acceptable break points in the line.
你get到了吗
展开
4
28