Adjust text box size
You can see the effect keep-all
and nowrap
CSS settings have by selecting different options and then adjusting the width of the text box to see how the text wraps:
word-break
setting for the text block to either normal
or keep-all
white-space
setting for each individual word to either normal
or nowrap
There are two ways Korean text should be split across lines (based on Cardinal Rules of Korean-Language Layout by Steven Bammel, president of Korean Consulting & Translation Service):
The default browser action is to split Korean words (as well as Chinese and Japanese) anywhere in the word, which is fine for justified text, but not good for left aligned text. The word-break: keep-all;
property, which keeps Korean words from splitting, was added to the CSS3 specification around 2011. As of 2015, all of the latest major browser versions support keep-all.
The problem is the Android internet browser that comes with many smartphones does not get updated the way other apps do. This leaves a number of potential visitors with a browser that doesn’t support keep-all
, which could result in some visitors having a different experience from what you have designed.
I wrap every Korean word in <span> </span>
tags, and style the tags as: white-space: nowrap;
. This keeps the words together. I use a JavaScript plugin to add the <span>
tags when the page loads.