Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

word-break:break-all和word-wrap:break-word的区别 #14

Open
Jeffersondyj opened this issue Aug 3, 2017 · 0 comments
Open

word-break:break-all和word-wrap:break-word的区别 #14

Jeffersondyj opened this issue Aug 3, 2017 · 0 comments

Comments

@Jeffersondyj
Copy link
Owner

word-break: normal / break-all / keep-all
normal: 使用默认的换行规则
break-all: 允许任意非CJK(Chinese/Japanese/Korean)文本间的单词断行
keep-all: 不允许CJK(Chinese/Japanese/Korean)文本中的单词换行,只能在半角空格或连字符处换行。非CJK文本的行为实际上和normal一致

word-wrap: normal / break-word
normal: 就是大家平常见得最多的正常的换行规则,文本会默认在空格之处换行,如果单个单词过长,而容器宽度不足够容纳这个单词,单词会溢出容器(非常坑)
break-word: 一行单词中实在没有其他靠谱的换行点的时候换行,在上面的基础上,会对过长的单词做词内断词处理,这样单词始终会在容器中,不会溢出容器

word-break:break-all(谐音:微博吧)正如其名字,所有的都换行。毫不留情,一点空隙都不放过
而word-wrap:break-word(谐音:我五百万)之所以换行,很可能是因为下面一行文字占满了整个容器的一行,于是就换行处理了

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant