English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
word-wrap Attribute Usage and Example
wrap CSS Attribute Specifies to prevent overflow, allowing long content to automatically wrap.
The following table provides usage instructions and version history of this attribute, as well as its usage syntax in JavaScript scripts. | normal |
---|---|
Default Value: | Applicable To: |
All Elements | Inheritance: |
Yes | Animatable:No. Please see. |
Animation Attribute | Version:3CSS |
New Feature of JavaScript Syntax: | object.style.wordWrap="break-word" |
The syntax of this attribute is as follows:
word-wrap: normal | break-word | initial | inherit
The following examples demonstrate how to use word-wrap Attribute.
p { width: 200px; background: #90ee90; word-wrap: break-word; }Test to see‹/›
The following table describes the values of this attribute.
Value | Description |
---|---|
normal | Only wrap at allowed hyphenation points (browsers keep the default processing). This is the default value. |
break-word | If there are no acceptable breakpoints in the line, force the non-breakable words to wrap to prevent overflow. |
initial | Set this attribute to its default value. |
inherit | If specified, the associated elements adopt the word wrap of their parent element.-wrap Attribute Values. |
word-Browser Compatibility of the wrap Attribute; the numbers in the table below represent the minimum browser version that supports this attribute; all mainstream browsers support this attribute.
|
Please refer to the following tutorials:CSS Text.
Related Attributes:word-break,white-space,text-overflow.