このページを日本語で閲覧するには「続ける」を押してください。
Press "Continue" to see this page in English.
2020
 
Aug
 
29
 

Japanese Line Breaking Issues in Web Design

Discover practical solutions to Japanese line breaking issues in web design. Learn how to use <span>, <wbr>, and modern CSS properties like overflow-wrap to improve readability and maintain clean layouts.

Sergei Voroshilov

Japanese Line Breaking Issues in Web Design

What is the Line Breaking Problem?

Hello everyone! I'm Sergey, the CTO of LikePay.

If you've ever worked with Japanese text on the web, you may have run into the issue where lines break at awkward or unnatural positions.

In the worst case, a single character may be left on a new line, causing readability and visual layout problems.

We explored two main solutions to tackle this problem. Each has its strengths and weaknesses, and we’ll walk through them here.

Solution 1: Wrapping with span Tags

One approach is to wrap units of text that shouldn't be broken with <span> tags and apply custom CSS to prevent unwanted line breaks.

HTML:

<p class="word-break">
  <span>「SNS×お店」をセットで楽しむ新アプリ。</span>
  <span>お店についてSNSに投稿するだけで、</span>
  <span>お金のように使える</span>
  <span>割引ポイントがもらえる!</span>
</p>

CSS:

.word-break > span {
  display: inline-block;
}

Pros:

  • You can control which parts of the text should not break

Cons:

  • HTML becomes verbose
  • Additional spacing issues between spans
  • Requires structured, consistent markup

Solution 2: Soft Breaks with wbr Tags

A more elegant solution is to insert <wbr> tags at places where a line break is acceptable.

HTML:

<p>
  「SNS×お店」をセットで楽しむ新アプリ。<wbr/>
  お店についてSNSに投稿するだけで、<wbr/>
  お金のように使える<wbr/>割引ポイントがもらえる!
</p>

CSS:

body {
  word-break: keep-all;
}

Pros:

  • Clean and straightforward markup
  • Full control over where breaks can occur

Cons:

  • None identified so far (as of 2020)

Solution 3 (As of 2025): Using CSS overflow-wrap and line-break

With modern CSS, you can control line breaking behavior more flexibly. While hyphens is still not fully effective for Japanese, using overflow-wrap: anywhere; and line-break: strict; can help browsers break lines more naturally.

Example:

p {
  overflow-wrap: anywhere;
  line-break: strict;
}

This allows the browser to decide appropriate breaking points without modifying the HTML.

Pros:

  • Requires only CSS, no changes to HTML
  • Good compatibility with modern browsers

Cons:

  • Minor differences in rendering across browsers
  • May not always produce ideal line breaks in Japanese (still improving)

Final Thoughts

Japanese line-breaking is deceptively tricky, but with the right approach, your web typography can be significantly improved.

We hope this article helps web designers dealing with similar issues. Feel free to reach out if you have questions or feedback!

Newsletter

Subscribe to updates

Signup for practical tips on growing your business online, useful updates and event info.

We respect your privacy and never send spam messages. You can unsubscribe anytime.

By sending this form you agree to Privacy Policy

送信しました。ありがとうございます。
送信中にエラーが発生しました。
Our customers

We help you grow on web

We are a web company based in Tokyo, Japan.

Our international team of web experts will help you solve any of your challenges.