📜  CSS word-break属性

📅  最后修改于: 2020-11-05 02:20:59             🧑  作者: Mango

CSS word-break

此CSS属性指定单词应在行尾处断开的方式。它定义了换行规则。使用此属性,内容框中不适合的行将在特定点断开。

句法

word-break: normal |keep-all |  break-all | inherit ;  

此属性的默认值为normal。因此,当我们不指定任何值时会自动使用它。

属性值

keep-all:以默认样式将单词打断。不应将其用于日文/中文/韩文(CJK)文本。

break-all:它在字符之间插入分词符,以防止单词溢出。应用此值时,浏览器将在任何时候断开换行。如果太长而无法容纳单词并且出现在行尾,则可能会使单词从中间断开。它不应用连字符。

initial:将属性设置为其默认值。

inherit:它从其父元素继承属性。

在此示例中,有三个容器。我们将正常值应用于第一个容器的内容,将全部值应用于第二个容器的内容,并将全部值应用于第三个容器的内容。






word-break: normal;

Hi, Welcome to the javaTpoint.com. This site is developed so that students may learn computer science related technologies easily. The javaTpoint.com is always providing an easy and in-depth tutorial on various technologies. No one is perfect in this world, and nothing is eternally best. But we can try to be better.

word-break: break-all;

Hi, Welcome to the javaTpoint.com. This site is developed so that students may learn computer science related technologies easily. The javaTpoint.com is always providing an easy and in-depth tutorial on various technologies. No one is perfect in this world, and nothing is eternally best. But we can try to be better.

word-break: keep-all;

Hi, Welcome to the javaTpoint.com. This site is developed so that students may learn computer science related technologies easily. The javaTpoint.com is always providing an easy and in-depth tutorial on various technologies. No one is perfect in this world, and nothing is eternally best. But we can try to be better.

输出量