Difference between overflow-wrap and word-break?

廉价感情. 提交于 2019-11-26 12:41:20

问题


What´s the exact difference between overflow-wrap/word-wrap and word-break? And can anybody tell me what´s the better one for breaking very long links? Most people say you should use word-break in combination with overflow-wrap but it doesn\'t look very logical. I think using overflow-wrap in combination with word-wrap for better cross-browser support is the best method. What do you think?


回答1:


Quoting from source

  • word-wrap: The word-wrap CSS property is used to specify whether or not the browser may break lines within words in order to prevent overflow when an otherwise unbreakable string is too long to fit in its containing box.

  • overflow-wrap: word-wrap property has been renamed overflow-wrap in the current draft of the CSS3 Text specification

  • word-break: The word-break CSS property is used to specify how (or if) to break lines within words

So, you need word-break in combination with word-wrap, which is the right combination.



来源:https://stackoverflow.com/questions/17259916/difference-between-overflow-wrap-and-word-break

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!