You are here: Reference > CSS > properties > browser specific extensions > -webkit-nbsp-mode

-webkit-nbsp-mode property

Browser support:
Specifies the behavior of non-breaking spaces within an element.
The browser's line breaking mechanism does not break lines at the 'nbsp' character as opposed to normal space characters. With this property you can change the behavior of 'nbsp' characters to work as normal spaces.
JavaScript page for this property: webkitNbspMode. You can find other example(s) there.

Possible values:

 One of the following values: 
inherit
Takes the value of this property from the computed style of the parent element.
normal
Default. Text should not be broken at non-breaking spaces.
space
The 'nbsp' characters work like normal spaces. Text can be broken at non-breaking spaces.
Default: normal.

Example HTML code 1:

This example illustrates the use of the -webkit-nbsp-mode property:
<head>
    <style>
        .example {
            width: 120px;
            height: 120px;
            overflow: auto;
            border: 1px solid #acacac;
        }
        .normal { 
            -webkit-nbsp-mode: normal;
        } 
        .space { 
            -webkit-nbsp-mode: space;
        } 
    </style>
</head>
<body>
    <div class="example normal">
        Text&nbsp;should&nbsp;not&nbsp;be&nbsp;broken&nbsp;at&nbsp;non-breaking&nbsp;spaces.
    </div>
    <div class="example space">
        Text&nbsp;can&nbsp;be&nbsp;broken&nbsp;at&nbsp;non-breaking&nbsp;spaces.
    </div>
</body>
Did you find this example helpful? yes no

Supported by tags:

External links:

User Contributed Comments

Post Content

Post Content