CSS PROPERTIES
Expand All | Collapse All
CSS AT-RULES

CSS3 word-wrap Property

Topic: CSS3 Properties ReferencePrev|Next

Description

The word-wrap CSS property specifies the line breaks within the word in order to prevent the overflow when a word is too long to fit within the content area of the element.

The following table summarizes the usages context and the version history of this property.

Default value: normal
Applies to: All elements
Inherited: yes
Animatable: No. See animatable properties.
Version: New in CSS3

Syntax

The syntax of the property is given with:

word-wrap normal | break-word | initial | inherit

The example below shows the word-wrap property in action.

p {
    width: 200px;
    background: #90ee90;
    word-wrap: break-word;
}

Property Values

The following table describes the values of this property.

Value Description
normal Lines may only break at normal word break points. This is default value.
break-word Force an unbreakable word to wrap in a new line in order to prevent overflow, if there are no acceptable break points in the line.
initial Sets this property to its default value.
inherit If specified, the associated element takes the computed value of its parent element word-wrap property.

Browser Compatibility

The word-wrap property is supported in all major modern browsers.

Browsers Icon

Basic Support—

  • Firefox 3.5+
  • Google Chrome 1+
  • Internet Explorer 5.5+
  • Apple Safari 1+
  • Opera 10.5+

Further Reading

See tutorial on: CSS Text.

Related properties: word-break, white-space, text-overflow.

Bootstrap UI Design Templates Property Marvels - A Leading Real Estate Portal for Premium Properties