Summary
The word-wrap CSS property is used to specify whether or not the browser may break lines within words in order to prevent overflow (in other words, force wrapping) when an otherwise unbreakable string is too long to fit in its containing box.
Note: Originally a Microsoft (unprefixed) proprietary extension, the word-wrap property has been renamed overflow-wrap in the current draft of the CSS3 Text specification. word-wrap is now considered an "alternate name" for overflow-wrap. Stable builds of Google Chrome and Opera support the new syntax.
Initial valuenormal
Applies to all elements
Inherited yes
Mediavisual
Computed value as specified
Animatable no
Canonical order the unique non-ambiguous order defined by the formal grammar
Syntax
Formal syntax: normal | break-word
word-wrap: normal
word-wrap: break-word
word-wrap: inherit
Values
normal
Indicates that lines may only break at normal word break points.
break-word
Indicates that normally unbreakable words may be broken at arbitrary points if there are no otherwise acceptable break points in the line.
Examples
p { width: 13em; background: gold; }
FStrPrivFinÄndG (Gesetz zur Änderung des Fernstraßenbauprivatfinanzierungsgesetzes und straßenverkehrsrechtlicher Vorschriften)
p { width: 13em; background: gold; word-wrap: break-word; }
FStrPrivFinÄndG (Gesetz zur Änderung des Fernstraßenbauprivatfinanzierungsgesetzes und straßenverkehrsrechtlicher Vorschriften)
Specifications
Specification Status Comment
CSS Text Level 3 Working Draft
Browser compatibility
Desktop Mobile
Feature Firefox (Gecko) Chrome Internet Explorer Opera Safari
Basic support 3.5 (1.9.1) 1.0 5.5 10.5 1.0
word-wrap:break-word can be used to work around lack of pre{white-space:pre-wrap} support in IE 5.5-7. See white-space for an example.
IE8 introduced -ms-word-wrap as a synonym for word-wrap. Don't use the -ms- prefix.
See also
Text-related CSS properties: Text-related properties: letter-spacing, text-align, text-decoration, text-decoration-color, text-decoration-line, text-decoration-style, text-rendering, text-shadow, text-transform, text-indent, white-space, word-spacing
The white-space property also controls wrapping.
Microsoft's original documentation: MSDN Microsoft library word-wrap
Document Tags and Contributors
Tags: CSSReferenceRéférenceWebCSS PropertyNeedsLiveSampleLayout
Contributors to this page: mkato, Sheppy, Jürgen Jeka, LouisLazaris, Nickolay, FredB, ethertank, Michael Ryan, kscarfone, Dynamis, mattbrundage, teoli, Chealer
Last updated by: Chealer, Oct 16, 2014 6:56:14 AM
最新の画像[もっと見る]
- ボリュームランチ 10年前
- イラストたくさん 10年前
- コメント許可しない、コメント0 10年前
- good morning☆ 10年前
- 江戸川の花火 10年前
- 江戸川の花火 10年前
- 誕生日プレゼント 10年前
- 誕生日プレゼント 10年前
- 誕生日プレゼント 10年前
- 俺のイタリアンあだち 10年前
※コメント投稿者のブログIDはブログ作成者のみに通知されます