--- title: <wbr> slug: Web/HTML/Element/wbr tags: - Element - HTML - HTML text-level semantics - Reference - Web translation_of: Web/HTML/Element/wbr --- <div>{{HTMLRef}}</div> <p><strong>HTML の <code><wbr></code> 要素</strong>は、改行可能位置 — テキスト内でブラウザーが任意で改行してよい位置を表しますが、この改行規則は必要のない場合は改行を行いません。</p> <div>{{EmbedInteractiveExample("pages/tabbed/wbr.html", "tabbed-shorter")}}</div> <div class="hidden">このデモのソースファイルは GitHub リポジトリに格納されています。デモプロジェクトに協力したい場合は、 <a href="https://github.com/mdn/interactive-examples">https://github.com/mdn/interactive-examples</a> をクローンしてプルリクエストを送信してください。</div> <table class="properties"> <tbody> <tr> <th scope="row"><a href="/ja/docs/Web/Guide/HTML/Content_categories">コンテンツカテゴリ</a></th> <td><a href="/ja/docs/Web/Guide/HTML/Content_categories#Flow_content">フローコンテンツ</a>, <a href="/ja/docs/Web/Guide/HTML/Content_categories#Phrasing_content">記述コンテンツ</a></td> </tr> <tr> <th scope="row">許可されている内容</th> <td>なし</td> </tr> <tr> <th scope="row">タグの省略</th> <td>この要素は{{Glossary("empty element", "空要素")}}です。開始タグは必須であり、終了タグを記述してはなりません。</td> </tr> <tr> <th scope="row">許可されている親要素</th> <td><a href="/ja/docs/Web/Guide/HTML/Content_categories#Phrasing_content">記述コンテンツ</a>を受け入れるすべての要素</td> </tr> <tr> <th scope="row">許可されている ARIA ロール</th> <td>すべて</td> </tr> <tr> <th scope="row">DOM インターフェイス</th> <td>{{domxref("HTMLElement")}}</td> </tr> </tbody> </table> <h2 id="Attributes" name="Attributes">属性</h2> <p>この要素には<a href="/ja/docs/Web/HTML/Global_attributes">グローバル属性</a>のみがあります。</p> <h2 id="Notes" name="Notes">メモ</h2> <p>UTF-8 エンコードを使用するページでは、 <code><wbr></code> 要素は <code>U+200B</code> <code>ZERO-WIDTH SPACE</code> コードポイントのように作用します。特に、この要素は Unicode bidi BN コードポイントのように作用するため、{{Glossary("bidi", "双方向性")}}には影響を与えません。 <code><div dir=rtl>123,<wbr>456</div></code> が 2 行に分かれないときは <code>456,123</code> ではなく <code>123,456</code> と表示されます。</p> <p>同じ理由で、 <code><wbr></code> 要素は改行位置でハイフンを生成しません。行末にのみハイフンを表示させるには、代わりにソフトハイフンの文字実体参照 (<code>&shy;</code>) を使用してください。</p> <p>この要素は Internet Explorer 5.5 で最初に実装され、 HTML5 で公式に定義されました。</p> <h2 id="Example" name="Example">例</h2> <p><em><a class="external" href="https://web.archive.org/web/20121105171040/http://styleguide.yahoo.com/">The Yahoo Style Guide</a></em> では、句読点などの区切り文字が行末に置かれることを避けるため <a class="external" href="https://web.archive.org/web/20121105171040/http://styleguide.yahoo.com/editing/treat-abbreviations-capitalization-and-titles-consistently/website-names-and-addresses">URL を句読点の<em>前</em>で改行する</a>ことを推奨しています。区切り文字が行末にあると、読者が URL の末尾を誤解する可能性があります。</p> <pre class="brush: html notranslate"><p>http://this<wbr>.is<wbr>.a<wbr>.really<wbr>.long<wbr>.example<wbr>.com/With<wbr>/deeper<wbr>/level<wbr>/pages<wbr>/deeper<wbr>/level<wbr>/pages<wbr>/deeper<wbr>/level<wbr>/pages<wbr>/deeper<wbr>/level<wbr>/pages<wbr>/deeper<wbr>/level<wbr>/pages</p> </pre> <p>{{EmbedLiveSample("Example")}}</p> <h2 id="Specifications" name="Specifications">仕様書</h2> <table class="standard-table"> <thead> <tr> <th scope="col">仕様書</th> <th scope="col">状態</th> <th scope="col">備考</th> </tr> </thead> <tbody> <tr> <td>{{SpecName('HTML WHATWG', 'semantics.html#the-wbr-element', '<wbr>')}}</td> <td>{{Spec2('HTML WHATWG')}}</td> <td></td> </tr> <tr> <td>{{SpecName('HTML5 W3C', 'text-level-semantics.html#the-wbr-element', '<wbr>')}}</td> <td>{{Spec2('HTML5 W3C')}}</td> <td></td> </tr> </tbody> </table> <h2 id="Browser_compatibility" name="Browser_compatibility">ブラウザーの互換性</h2> <div class="hidden">このページの互換性一覧表は構造化データから生成されています。データに協力していただけるのであれば、 <a class="external" href="https://github.com/mdn/browser-compat-data">https://github.com/mdn/browser-compat-data</a> をチェックアウトしてプルリクエストを送信してください。</div> <p>{{Compat("html.elements.wbr")}}</p> <h2 id="See_also" name="See_also">関連情報</h2> <ul> <li>{{cssxref("overflow-wrap")}}</li> <li>{{cssxref("word-break")}}</li> <li>{{cssxref("hyphens")}}</li> </ul>