Why doesn't word-wrap work properly in CSS3?

user930514 picture user930514 · Dec 11, 2012 · Viewed 90.1k times · Source

Why doesn't word wrap property work properly in the example below?

http://jsfiddle.net/k5VET/739/

What can I do to ensure that part of the word 'consectetur' fits in the first line itself? I want maximum number of characters to fit in each line.

The css is :

#fos { font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
    font-size:14px;
    font-weight: normal;
    line-height: 18px;
    width: 238px;
    height:38px;
    cursor: pointer;
    word-wrap:break-word;
    border:2px solid; }

Answer

Jason Leung picture Jason Leung · Mar 2, 2015

If word-wrap: break-all don't work, try also add this:

white-space:normal;

work for me with the .btn class in Bootstrap 3