Language
日本語
English

Caution

JavaScript is disabled in your browser.
This site uses JavaScript for features such as search.
For the best experience, please enable JavaScript before browsing this site.

CSS Dictionary

  1. Home
  2. CSS Dictionary
  3. word-wrap

word-wrap

Specifies whether line breaks are allowed in the middle of words.

Sample Code

p.test { word-wrap: normal;}
p.test1 { word-wrap: break-word;}

Available Values

ValueDescription
normalDoes not break words in the middle. This 'normal' is the initial value.
break-wordBreaks lines to fit within the containing element's width, regardless of whether the break occurs in the middle of a word.

Browser Display Result

<p style="word-wrap: normal; width: 300px; border: solid 1px;">This is a p element. 'word-wrap: normal' is specified. this is a pen. Abcdefghijklmnopqrstuvwxyz AbcdefghijklmnopqrstuvwxyzAbcdefghijklmnopqrstuvwxyz</p>

<p style="word-wrap: break-word; width: 300px; border: solid 1px;">This is a p element. 'word-wrap: break-word' is specified. this is a pen. Abcdefghijklmnopqrstuvwxyz AbcdefghijklmnopqrstuvwxyzAbcdefghijklmnopqrstuvwxyz</p>

Browser Compatibility

Chrome Chrome
23+
22
21
20
19
18
17
16
15
↑ Supported as 'word-wrap'
Firefox Firefox
49+
48
47
46
45
44
43
42
41
↑ Supported as 'word-wrap'
2 and earlier ×
Safari Safari
7+
6
5
4
3
2
1
↑ Supported as 'word-wrap'
Edge Edge
18+
Supported in all versions
IE IE
11
10
9
8
7
6
Opera Opera
12.1+
11
↑ Supported as 'word-wrap'
9 and earlier ×
iOS Safari iOS Safari
7+
6
5
4
3
2
1
↑ Supported as 'word-wrap'
Android Android Browser
4.4+
1
Chrome Android Chrome Android
Latest
Same support as desktop
Firefox Android Firefox Android
Latest
Same support as desktop

※ Version data is based on MDN / Can I Use.

Details

Specifies whether line breaks are allowed in the middle of words.

Note that in addition to 'word-wrap', there are also the 'word-break' and 'overflow-wrap' properties, which also control whether words can be broken mid-word.

The 'word-break' property was originally introduced by IE, while 'overflow-wrap' is the renamed version of 'word-wrap' as proposed in the CSS specification.

For current browsers, specifying just the 'word-wrap' property should be sufficient.

If you find any errors or copyright issues, please .