word-break

  • Revision slug: CSS/word-break
  • Revision title: word-break
  • Revision id: 5664
  • Created:
  • Creator: mkato
  • Is current revision? No
  • Comment one or more formatting changes

Revision Content

{{ CSSRef() }}

Summary

The word-break CSS property is used to to specify line break rule within words.

  • {{ Xref_cssinitial() }}: {{ Cssxref("normal") }}
  • Applies to: all elements
  • {{ Xref_cssinherited() }}: yes
  • Media: {{ Xref_cssvisual() }}
  • {{ Xref_csscomputed() }}: specified value

Syntax

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

Value

normal
break line by normal rule
break-all
break each character for non-CJK
keep-all
disallow break for CJK text.  non-CJK text behaviour is same as normal.

Examples

Specifications

Specification Status Comment
CSS Text Level 3 {{ Spec2('CSS3 Text') }}  

Browser compatibility

{{ CompatibilityTable() }}

Feature Firefox (Gecko) Chrome Internet Explorer Opera Safari
Basic support {{ CompatGeckoDesktop("15.0") }} 1.0 5.5 {{ CompatNo() }} {{ CompatUnknown() }}
keep-all {{ CompatGeckoDesktop("15.0") }} {{ CompatNo() }} 5.5 {{ CompatNo() }} {{ CompatNo() }}
Feature Android Firefox Mobile (Gecko) IE Mobile Opera Mobile Safari Mobile
Basic support {{ CompatUnknown() }} {{ CompatGeckoMobile("15.0") }} {{ CompatUnknown() }} {{ CompatNo() }} {{ CompatUnknown() }}
keep-all {{ CompatNo() }} {{ CompatGeckoMobile("15.0") }} {{ CompatUnknown() }} {{ CompatNo() }} {{ CompatNo() }}
  • IE8 introduced -ms-word-break as a synonym for word-break. Don't use the -ms- prefix.

See also

  • Text-related CSS properties: {{ CSS_Reference:Text() }}

Revision Source

<p>{{ CSSRef() }}</p>
<h2>Summary</h2>
<p>The <code>word-break</code> CSS property is used to to specify line break rule within words.</p>
<ul class="cssprop"> <li><dfn>{{ Xref_cssinitial() }}:</dfn> {{ Cssxref("normal") }}</li> <li><dfn>Applies to:</dfn> all elements</li> <li><dfn>{{ Xref_cssinherited() }}:</dfn> yes</li> <li><dfn>Media:</dfn> {{ Xref_cssvisual() }}</li> <li><dfn>{{ Xref_csscomputed() }}:</dfn> specified value</li>
</ul>
<h2>Syntax</h2>
<pre>word-break:  normal | break-all | keep-all
</pre>
<h2>Value</h2>
<dl> <dt>normal</dt> <dd>break line by normal rule</dd> <dt>break-all</dt> <dd>break each character for non-CJK</dd> <dt>keep-all</dt> <dd>disallow break for CJK text.  non-CJK text behaviour is same as normal.</dd>
</dl>
<h2>Examples</h2>
<h2>Specifications</h2>
<table class="standard-table"> <thead> <tr style="background-color: rgb(255, 204, 255);"> <th scope="col">Specification</th> <th scope="col">Status</th> <th scope="col">Comment</th> </tr> </thead> <tbody> <tr> <td><a class="external" href="http://dev.w3.org/csswg/css3-text/#word-break" title="http://dev.w3.org/csswg/css3-text/#word-break">CSS Text Level 3</a></td> <td>{{ Spec2('CSS3 Text') }}</td> <td> </td> </tr> </tbody>
</table>
<h2>Browser compatibility</h2>
<p>{{ CompatibilityTable() }}</p>
<div id="compat-desktop"> <table class="compat-table"> <tbody> <tr> <th>Feature</th> <th>Firefox (Gecko)</th> <th>Chrome</th> <th>Internet Explorer</th> <th>Opera</th> <th>Safari</th> </tr> <tr> <td>Basic support</td> <td>{{ CompatGeckoDesktop("15.0") }}</td> <td>1.0</td> <td>5.5</td> <td>{{ CompatNo() }}</td> <td>{{ CompatUnknown() }}</td> </tr> <tr> <td><code>keep-all</code></td> <td>{{ CompatGeckoDesktop("15.0") }}</td> <td>{{ CompatNo() }} <a class="link-https" href="https://bugs.webkit.org/show_bug.cgi?id=43917" title="https://bugs.webkit.org/show_bug.cgi?id=43917"></a></td> <td>5.5</td> <td>{{ CompatNo() }}</td> <td>{{ CompatNo() }} <a class="link-https" href="https://bugs.webkit.org/show_bug.cgi?id=43917" title="https://bugs.webkit.org/show_bug.cgi?id=43917"></a></td> </tr> </tbody> </table>
</div>
<div id="compat-mobile"> <table class="compat-table"> <tbody> <tr> <th>Feature</th> <th>Android</th> <th>Firefox Mobile (Gecko)</th> <th>IE Mobile</th> <th>Opera Mobile</th> <th>Safari Mobile</th> </tr> <tr> <td>Basic support</td> <td>{{ CompatUnknown() }}</td> <td>{{ CompatGeckoMobile("15.0") }}</td> <td>{{ CompatUnknown() }}</td> <td>{{ CompatNo() }}</td> <td>{{ CompatUnknown() }}</td> </tr> <tr> <td><code>keep-all</code></td> <td>{{ CompatNo() }} <a class="link-https" href="https://bugs.webkit.org/show_bug.cgi?id=43917" title="https://bugs.webkit.org/show_bug.cgi?id=43917"></a></td> <td>{{ CompatGeckoMobile("15.0") }}</td> <td>{{ CompatUnknown() }}</td> <td>{{ CompatNo() }}</td> <td>{{ CompatNo() }} <a class="link-https" href="https://bugs.webkit.org/show_bug.cgi?id=43917" title="https://bugs.webkit.org/show_bug.cgi?id=43917"></a></td> </tr> </tbody> </table>
</div>
<ul> <li>IE8 introduced<code> -ms-word-break </code>as a synonym for<code> word-break</code>. Don't use the <code>-ms-</code> prefix.</li>
</ul>
<h2>See also</h2>
<ul> <li>Text-related CSS properties: {{ CSS_Reference:Text() }}</li>
</ul>
Revert to this revision