You are here: Reference > JavaScript > client-side > style handling > properties > lineBreak

lineBreak style property

Browser support:
Specifies or returns the line-breaking rules for Chinese, Japanese or Korean text.
This property is deprecated, use the wordBreak property instead.

Syntax:

object.lineBreak;
You can find the related objects in the Supported by objects section below.
This property is read/write.
CSS page for this property: line-break

Possible values:

The type of this property is string.
 One of the following values: 
normal
Default. Normal line-breaking rules are applied.
strict
Stricter line-breaking rules are enforced.
Default: normal.

Example HTML code 1:

This example shows how the line-break property should work:
<head>
    <style>
        .example {
            line-break: strict;
        }
    </style>
</head>
<body>
    <!-- The sky is as blue as blue can be.-->
    <span class="example">空はあくまでも青い。</span>
</body>
Did you find this example helpful? yes no

Example HTML code 2:

This example illustrates the use of the lineBreak property in JavaScript:
<head>
    <script type="text/javascript">
        function ChangeLineBreak (selectTag) {
            // Returns the index of the selected option
            var whichSelected = selectTag.selectedIndex;

            // Returns the selected options values
            var breakType = selectTag.options[whichSelected].text;

            var span = document.getElementById ("mySpan");

            if ('lineBreak' in span.style) {
                span.style.lineBreak = breakType;
            } else {
                alert ("Your browser doesn't support this example!");
            }
        }
    </script>
</head>
<body>
    <!-- The sky is as blue as blue can be.-->
    <span id="mySpan" class="example">空はあくまでも青い。</span>

    <br />
    <select onchange="ChangeLineBreak (this);" size="2">
        <option selected="selected" />normal
        <option />strict
    </select>
</body>
Did you find this example helpful? yes no

Supported by objects:

Related pages:

External links:

User Contributed Comments

Post Content

Post Content