7

I'm trying to display various texts on small screens (phones)
text is justified but it happens that there is a line with long word /formula / string, that won't fit

There is the possible word-break: break-all;, but it breaks lines too arbitrary, I would need a in-between solution like shows the following:

http://jsfiddle.net/Jsa5t/

3 Answers3

10

Insert the <wbr> tag to specify an allowed direct line breaking opportunity.

The theoretically more correct method is to insert the zero-width space character, U+200B (&#x200b;), but it fails badly on some old browsers.

A treatise on preventing and allowing line breaks in HTML: http://www.cs.tut.fi/~jkorpela/html/nobr.html

Jukka K. Korpela
  • 195,524
  • 37
  • 270
  • 390
  • It does its job when used to specify line breaking opportunities: http://jsfiddle.net/TXWtH/ There is no end tag, and the tag is to be placed at each point where you wish to allow a line break. – Jukka K. Korpela Apr 29 '12 at 16:43
2

not sure what your asking but you can use

word-wrap:break-word

breezy
  • 1,910
  • 1
  • 18
  • 35
0

If you can new line when have an dot(.) text try this code on your css file:

.your_class{
white-space: pre-line !important;
}
Bruno Pinna
  • 123
  • 11