line-break

CSS line-break Property

The line-break property specifies how to break lines of Chinese, Japanese, or Korean text working with punctuation and symbols. But, these languages have different rules. This line break might not occur. For example, if the value is set to “strict”, break before hyphens are not allowed in Chinese and Japanese languages.

The CSS specification emphasizes rules only for Chinese, Japanese and Korean.

For maximum browser compatibility extensions such as -webkit- for Safari, Google Chrome, and Opera (newer versions), -moz- for Firefox, -o- for older versions of Opera are used with this property.

The line-break is deprecated, use the word-break property instead.

类目类目
Initial Valueauto
Applies toAll elements.
InheritedYes.
AnimatableNo.
VersionCSS3
DOM Syntaxobject.style.lineBreak = “loose”;

Syntax

Syntax

line-break: auto | loose | normal | strict | initial | inherit;

Example of the line-break property:

<!DOCTYPE html>
<html>
  <head>
    <style>
      .korean {
        line-break: strict;
      }
    </style>
  </head>
  <body>
    <h2>Line-break property example</h2>
    <!--Be the change you want to see in the world.-->
    <span class="korean">세상에서 보고싶은 변화가 있다면 당신 스스로 그 변화가 되어라.</span>
  </body>
</html>

Result

Example of the line-break property with the “normal” value:

<!DOCTYPE html>
<html>
  <head>
    <title>Title of the document</title>
    <style>
      p {
        font-size: 16px;
        line-height: 24px;
        line-break: normal;
      }
    </style>
  </head>
  <body>
    <h2>Line-break property example</h2>
    <p>Lorem Ipsum is dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s when an unknown printer took a galley of type and scrambled it to make a type specimen book.
    </p>
  </body>
</html>

Values

Values

ValueDescription
autoBreaks the text using the default line break rule which is decided by the browser. Each browser has a default rule for showing the line breaks. auto is the default value of this property.
normalBreaks the text using the least restrictive line break rule: such as in newspapers.
looseBreaks the text using the most common line break rule.
strictBreaks the text using the most stringent line break rule.
initialSets the property to its default value.
inheritInherits the property from its parent element.


请遵守《互联网环境法规》文明发言,欢迎讨论问题
扫码反馈

扫一扫,反馈当前页面

咨询反馈
扫码关注
返回顶部