What is the difference between “word-break: break-all” versus “word-wrap: break-word” in CSS

前端 未结 10 1353
离开以前
离开以前 2020-11-22 07:39

I am currently wondering what is the difference between the two. When I used both they seem to break the word if it is not fitting the container. But why did W3C made two wa

10条回答
  •  星月不相逢
    2020-11-22 08:11

    This is all i can find out. Not sure if it helps, but thought I'd add it to the mix.

    WORD-WRAP

    This property specifies whether the current rendered line should break if the content exceeds the boundary of the specified rendering box for an element (this is similar in some ways to the ‘clip’ and ‘overflow’ properties in intent.) This property should only apply if the element has a visual rendering, is an inline element with explicit height/width, is absolutely positioned and/or is a block element.

    WORD-BREAK

    This property controls the line breaking behavior within words. It is especially useful in cases where multiple languages are used within an element.

提交回复
热议问题