How do I make HTML break just a word?

The corrected text in HTML is broken with or without a hyphen, or if warranted by a word.

How can I make the spoken text break just a word and be cut short?

Example:

Fast young fox jumping ov -

er lazy chicken.

Desired output:

Fast young fox jumping

over a lazy chicken.

+3


source to share


2 answers


The property you are looking for is word-break

word-break: break-all;

      

Check out this fiddle: http://jsfiddle.net/376qL5Lg/




To make the line continue without breaks, the approach is:

white-space: nowrap;

      

Fiddle: http://jsfiddle.net/7km0c6mb/

+4


source


You can try the word-wrap css property.



word-wrap: break-word;

      

0


source







All Articles