タイトル: hyphensプロパティ
SEOタイトル: CSS hyphens プロパティ|英単語のハイフネーション自動化・lang属性との関係・ブラウザ対応
この本文には実行可能なタグ等が含まれるため、安全のためHTMLソースとして表示しています。本文データは変更していません。
<table border="1" cellpadding="6" cellspacing="0" style="border-collapse:collapse;background:#fffbea;border:1px solid #f4c430;margin:1em 0;width:100%"><tr><td style="background:#f4c430;color:#000;font-weight:bold;padding:8px">この記事の要点</td></tr><tr><td style="padding:10px"><ul><li><strong>hyphens</strong> は<strong>英単語の自動ハイフネーション</strong>(行末で単語を分割しハイフン <code>-</code> を入れる)を制御する CSS プロパティ</li><li>値は <code>none</code> / <code>manual</code> / <code>auto</code>。既定は <code>manual</code></li><li><code>auto</code> を効かせるには <code>html lang="en"</code> のように<strong>言語属性</strong>が必須。日本語 (<code>lang="ja"</code>) では基本的に効かない</li><li><code>­</code>(ソフトハイフン)や <code>‐</code>(明示ハイフン)を <code>manual</code> 値と組み合わせると<strong>狙った位置でだけ分割</strong>できる</li><li>Safari は古くから <code>-webkit-hyphens</code> プレフィックスが必要だったが、現代ブラウザはほぼ標準対応</li></ul></td></tr></table>
<h2>hyphens とは</h2>
<p><strong>hyphens</strong> は CSS のテキスト整形プロパティの 1 つで、<strong>長い英単語が行末に来た時にハイフン (<code>-</code>) を入れて自動的に折り返す</strong>「ハイフネーション」機能を制御します。新聞や書籍の英文組版でおなじみの処理を、ブラウザ上で実現できます。</p>
<h2>構文と値</h2>
<pre style="background:#1e293b;color:#e2e8f0;padding:1em;border-radius:6px;overflow-x:auto;line-height:1.5"><code class="language-css">selector {
hyphens: none | manual | auto;
}</code></pre>
<table border="1" cellpadding="6" cellspacing="0" style="border-collapse:collapse;width:100%">
<thead><tr style="background:#e3f2fd"><th>値</th><th>意味</th></tr></thead>
<tbody>
<tr><td>none</td><td>ハイフン分割を一切行わない。<code>­</code> も無視</td></tr>
<tr><td>manual (既定)</td><td><code>­</code> や明示ハイフンがある場所でだけ分割可能</td></tr>
<tr><td>auto</td><td>ブラウザが言語辞書を使って<strong>自動分割</strong>。<code>lang</code> 属性必須</td></tr>
</tbody>
</table>
<h2>auto を効かせるための条件</h2>
<p><code>hyphens: auto</code> は単独では効きません。<strong>HTML 側で言語属性を指定</strong>する必要があります。</p>
<pre style="background:#1e293b;color:#e2e8f0;padding:1em;border-radius:6px;overflow-x:auto;line-height:1.5"><code class="language-html"><!DOCTYPE html>
<html lang="en">
<head><meta charset="UTF-8"></head>
<body>
<p style="width:160px; text-align:justify; hyphens:auto;">
This is an internationalization example.
</p>
</body>
</html></code></pre>
<p>上記のように <code>html lang="en"</code> がないと、ブラウザはどの言語の辞書を使うか分からず、ハイフネーションを行いません。</p>
<h3>言語が混在する場合</h3>
<pre style="background:#1e293b;color:#e2e8f0;padding:1em;border-radius:6px;overflow-x:auto;line-height:1.5"><code class="language-html"><p>本文は日本語ですが、ここだけ
<span lang="en" style="hyphens:auto">internationalization</span>
が英語です。
</p></code></pre>
<h2>manual で狙った位置だけ分割する</h2>
<p>長い単語の「ここなら切れていい」位置に <strong>ソフトハイフン (<code>­</code>)</strong> を入れると、行末に来た時だけハイフンが表示されます。</p>
<pre style="background:#1e293b;color:#e2e8f0;padding:1em;border-radius:6px;overflow-x:auto;line-height:1.5"><code class="language-html"><p style="width:120px; hyphens:manual;">
inter­national­ization
</p></code></pre>
<p>表示上は <code>internationalization</code> のままですが、行末では <code>inter-</code> / <code>national-</code> / <code>ization</code> のどこかで折り返されます。</p>
<h2>日本語との関係</h2>
<p>日本語は基本的に<strong>1 文字単位で改行</strong>するため、英語のようなハイフネーションは不要です。<code>hyphens: auto</code> を指定しても、<code>lang="ja"</code> ではほぼ何もしません。</p>
<p>日本語の禁則処理(行頭禁則・行末禁則)は <strong><a href="/article/10666">word-breakプロパティ</a></strong> や <code>line-break</code> プロパティで制御します。</p>
<h2>ブラウザ対応とプレフィックス</h2>
<p>2026 年現在は標準で <code>hyphens</code> が使えますが、旧 Safari 用に<strong>ベンダープレフィックス</strong>を併記する保守的な書き方もあります。</p>
<pre style="background:#1e293b;color:#e2e8f0;padding:1em;border-radius:6px;overflow-x:auto;line-height:1.5"><code class="language-css">.text {
-webkit-hyphens: auto;
-ms-hyphens: auto;
hyphens: auto;
}</code></pre>
<h2>典型ユースケース</h2>
<h3>1. 狭幅レイアウトの英文記事</h3>
<p>スマホやサイドバーなど<strong>幅が狭い領域</strong>に英文を流す時に、長い専門用語が改行できずレイアウトが崩れる問題を緩和します。</p>
<pre style="background:#1e293b;color:#e2e8f0;padding:1em;border-radius:6px;overflow-x:auto;line-height:1.5"><code class="language-css">article p {
hyphens: auto;
text-align: justify;
}</code></pre>
<h3>2. 多言語サイトのレスポンシブ対応</h3>
<pre style="background:#1e293b;color:#e2e8f0;padding:1em;border-radius:6px;overflow-x:auto;line-height:1.5"><code class="language-css">@media (max-width: 600px) {
:lang(en), :lang(de) {
hyphens: auto;
}
}</code></pre>
<h2>関連プロパティ</h2>
<table border="1" cellpadding="6" cellspacing="0" style="border-collapse:collapse;width:100%">
<thead><tr style="background:#e3f2fd"><th>プロパティ</th><th>役割</th></tr></thead>
<tbody>
<tr><td>word-break</td><td>単語分割の方針</td></tr>
<tr><td>line-break</td><td>句読点・記号の禁則処理</td></tr>
<tr><td>overflow-wrap</td><td>はみ出し時の強制改行</td></tr>
<tr><td>text-align: justify</td><td>両端揃え(hyphens と相性が良い)</td></tr>
</tbody>
</table>
<h2>hyphenate-character / hyphenate-limit-chars</h2>
<p>近年のブラウザでは、ハイフネーションの<strong>記号と粒度</strong>を制御する追加プロパティが利用できます。</p>
<table border="1" cellpadding="6" cellspacing="0" style="border-collapse:collapse;width:100%">
<thead><tr style="background:#e3f2fd"><th>プロパティ</th><th>役割</th><th>例</th></tr></thead>
<tbody>
<tr><td>hyphenate-character</td><td>分割時に挿入する記号を変更</td><td><code>hyphenate-character: "⸗";</code></td></tr>
<tr><td>hyphenate-limit-chars</td><td>分割を許可する最小単語長と前後の文字数</td><td><code>hyphenate-limit-chars: 6 3 2;</code></td></tr>
</tbody>
</table>
<pre style="background:#1e293b;color:#e2e8f0;padding:1em;border-radius:6px;overflow-x:auto;line-height:1.5"><code class="language-css">p {
hyphens: auto;
hyphenate-limit-chars: 6 3 2; /* 6文字以上の語、前後3/2文字以上残す */
text-align: justify;
}</code></pre>
<h2>justify と組み合わせるときのコツ</h2>
<p><code>text-align: justify</code> だけだと、単語間の<strong>スペースが広がりすぎて読みづらい</strong>「川 (river)」現象が起きがちです。<code>hyphens: auto</code> を併用するとスペースが詰まり、自然な組版になります。</p>
<h2>FAQ</h2>
<p><strong>Q. CJK には効きませんか?</strong><br />
A. はい、原則的に効きません。日本語・中国語・韓国語は<strong>1 文字単位での折り返し</strong>が基本のため、<code>word-break</code> / <code>overflow-wrap</code> / <code>line-break</code> を使い分けます。</p>
<p><strong>Q. <code>auto</code> なのにハイフンが入らない</strong><br />
A. ① <code>lang</code> 属性が設定されていない、② 親要素に英語以外の <code>lang</code> がある、③ そもそも単語が分割可能な長さに満たない、のいずれかを疑います。</p>
<p><strong>Q. デザイン上ハイフンの形を変えたい</strong><br />
A. <code>hyphenate-character: "-";</code> 等で記号を任意に変更可能です(対応ブラウザ要確認)。</p>
<h2>言語別の挙動</h2>
<table border="1" cellpadding="6" cellspacing="0" style="border-collapse:collapse;width:100%">
<thead><tr style="background:#e3f2fd"><th>lang</th><th>auto の効果</th><th>備考</th></tr></thead>
<tbody>
<tr><td>en</td><td>強く効く(辞書が充実)</td><td>欧文組版で最も恩恵が大きい</td></tr>
<tr><td>de / fr</td><td>強く効く</td><td>長い合成語に効果絶大</td></tr>
<tr><td>es / it / pt</td><td>効く</td><td>—</td></tr>
<tr><td>ja / zh / ko</td><td>ほぼ無効</td><td>1 文字単位で折り返すため不要</td></tr>
</tbody>
</table>
<h2>実務での適用パターン</h2>
<p>狭幅レイアウトのブログ・ニュースサイトで以下のように一括指定するのがおすすめです。</p>
<pre style="background:#1e293b;color:#e2e8f0;padding:1em;border-radius:6px;overflow-x:auto;line-height:1.5"><code class="language-css">article {
text-align: justify;
hyphens: auto;
overflow-wrap: anywhere; /* 万一の長い文字列も折り返す */
word-break: normal;
}
/* 日本語側はハイフネーション無効でも問題なし */
:lang(ja) article {
text-align: left;
hyphens: manual;
}</code></pre>
<h2>関連</h2>
<ul>
<li><a href="/article/10666">word-breakプロパティ</a></li>
<li><a href="/article/10703">text-alignプロパティ</a></li>
<li><a href="/article/10665">text-decoration関連のプロパティ</a></li>
<li><a href="/article/10705">line-heightプロパティ</a></li>
<li><a href="/article/10033">CSS</a></li>
</ul>