From 4ace0769da3bc823dd8a3d86211cefa850ce3007 Mon Sep 17 00:00:00 2001 From: Masahiro FUJIMOTO Date: Tue, 5 Oct 2021 01:44:43 +0900 Subject: CSS Text モジュールの文書を更新 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 2021/08/13 時点の英語版に同期 - Web/CSS/CSS_Text/Wrapping_Text を新規翻訳 --- files/ja/web/css/overflow-wrap/index.md | 158 +++++++++++++++----------------- 1 file changed, 73 insertions(+), 85 deletions(-) (limited to 'files/ja/web/css/overflow-wrap/index.md') diff --git a/files/ja/web/css/overflow-wrap/index.md b/files/ja/web/css/overflow-wrap/index.md index 3d7387d243..9c76cd9af0 100644 --- a/files/ja/web/css/overflow-wrap/index.md +++ b/files/ja/web/css/overflow-wrap/index.md @@ -6,25 +6,24 @@ tags: - CSS テキスト - CSS プロパティ - Reference + - recipe:css-property +browser-compat: css.properties.overflow-wrap translation_of: Web/CSS/overflow-wrap --- -
{{CSSRef}}
+{{CSSRef}} -

overflow-wrapCSS のプロパティで、インライン要素に対して、テキストが行ボックスをあふれないように、ブラウザーが不可分の文字列の途中で改行を入れるかどうかの設定を適用します。

+**`overflow-wrap`** は [CSS](/ja/docs/Web/CSS) のプロパティで、インライン要素に対して、テキストが行ボックスをあふれないように、ブラウザーが分割できない文字列の途中で改行を入れるかどうかの設定を適用します。 -
{{EmbedInteractiveExample("pages/css/overflow-wrap.html")}}
+{{EmbedInteractiveExample("pages/css/overflow-wrap.html")}} - +> **Note:** {{cssxref("word-break")}} とは対照的に、 `overflow-wrap` は単語全体があふれずに行内に配置できない場合にのみ、改行を生成します。 -
-

メモ: {{cssxref("word-break")}} とは対照的に、 overflow-wrap は単語全体があふれずに行内に配置できない場合にのみ、改行を生成します。

-
+このプロパティはもともと、標準外かつ接頭辞のない `word-wrap` と呼ばれる Microsoft 拡張であり、多くのブラウザーはこの名前で実装していました。 `overflow-wrap` に改名されたため、 `word-wrap` は別名になりました。 -

このプロパティはもともと、標準外かつ接頭辞のない word-wrap と呼ばれる Microsoft 拡張であり、多くのブラウザーはこの名前で実装していました。 overflow-wrap に改名されたため、 word-wrap は別名になりました。

+## 構文 -

構文

- -
/* キーワード値 */
+```css
+/* キーワード値 */
 overflow-wrap: normal;
 overflow-wrap: break-word;
 overflow-wrap: anywhere;
@@ -32,58 +31,65 @@ overflow-wrap: anywhere;
 /* グローバル値 */
 overflow-wrap: inherit;
 overflow-wrap: initial;
+overflow-wrap: revert;
 overflow-wrap: unset;
-
+``` + +`overflow-wrap` プロパティは、以下のうちの一つのキーワードで指定します。 -

overflow-wrap プロパティは、下記の値一覧中の一つのキーワードで指定します。

+### 値 -

+- `normal` + - : 通常の単語の分割位置 (2 つの単語の間の空白など) でのみ改行することを示します。 +- `anywhere` + - : あふれることを避けるために、行内にその他の分割可能な位置がない場合、その他の分割できない文字列 — 長い単語や URL — が任意の場所で分割されることがあります。分割位置にハイフン文字は挿入されません。コンテンツの最小固有寸法を計算する時には、単語分割によって導入された折り返し可能位置が考慮されます。 +- `break-word` + - : `anywhere` の値と同様に、行内にその他の分割可能な位置がない場合、通常は分割可能でない単語が任意の場所で分割されますが、コンテンツの最小固有寸法を計算する時に、単語分割によって導入された折り返し可能位置が考慮されません。 -
-
normal
-
通常の単語の分割位置 (2つの単語の間の空白など) でのみ改行することを示します。
-
anywhere
-
あふれることを避けるために、行内にその他の分割可能な位置がない場合、その他の分割できない文字列 — 長い単語や URL — が任意の場所で分割されることがあります。分割位置にハイフン文字は挿入されません。コンテンツの最小固有寸法を計算する時には、単語分割によって導入された折り返し可能位置が考慮されます。
-
break-word
-
anywhere の値と同様に、行内にその他の分割可能な位置がない場合、通常は分割可能でない単語が任意の場所で分割されますが、コンテンツの最小固有寸法を計算する時に、単語分割によって導入された折り返し可能位置が考慮されません。
-
+## 公式定義 -

形式文法

+{{cssinfo}} + +## 形式文法 {{csssyntax}} -

- -

この例は、長い単語が分割されるときの overflow-wrap, word-break, and hyphens の結果を比較するものです。

- -

HTML

- -
<p>They say the fishing is excellent at
-  Lake <em class="normal">Chargoggagoggmanchauggagoggchaubunagungamaugg</em>,
-  though I've never been there myself. (<code>normal</code>)</p>
-<p>They say the fishing is excellent at
-  Lake <em class="ow-anywhere">Chargoggagoggmanchauggagoggchaubunagungamaugg</em>,
-  though I've never been there myself. (<code>overflow-wrap: anywhere</code>)</p>
-<p>They say the fishing is excellent at
-  Lake <em class="ow-break-word">Chargoggagoggmanchauggagoggchaubunagungamaugg</em>,
-  though I've never been there myself. (<code>overflow-wrap: break-word</code>)</p>
-<p>They say the fishing is excellent at
-  Lake <em class="word-break">Chargoggagoggmanchauggagoggchaubunagungamaugg</em>,
-  though I've never been there myself. (<code>word-break</code>)</p>
-<p>They say the fishing is excellent at
-  Lake <em class="hyphens">Chargoggagoggmanchauggagoggchaubunagungamaugg</em>,
-  though I've never been there myself. (<code>hyphens</code>, without <code>lang</code> attribute)</p>
-<p lang="en">They say the fishing is excellent at
-  Lake <em class="hyphens">Chargoggagoggmanchauggagoggchaubunagungamaugg</em>,
-  though I've never been there myself. (<code>hyphens</code>, English rules)</p>
-<p class="hyphens" lang="de">They say the fishing is excellent at
-  Lake <em class="hyphens">Chargoggagoggmanchauggagoggchaubunagungamaugg</em>,
-  though I've never been there myself. (<code>hyphens</code>, German rules)</p>
-
- -

CSS

- -
p {
+## 例
+
+

overflow-wrap, word-break, hyphens の比較

+ +この例は、長い単語が分割されるときの `overflow-wrap`, `word-break`, `hyphens` の結果を比較するものです。 + +#### HTML + +```html +

They say the fishing is excellent at + Lake Chargoggagoggmanchauggagoggchaubunagungamaugg, + though I've never been there myself. (normal)

+

They say the fishing is excellent at + Lake Chargoggagoggmanchauggagoggchaubunagungamaugg, + though I've never been there myself. (overflow-wrap: anywhere)

+

They say the fishing is excellent at + Lake Chargoggagoggmanchauggagoggchaubunagungamaugg, + though I've never been there myself. (overflow-wrap: break-word)

+

They say the fishing is excellent at + Lake Chargoggagoggmanchauggagoggchaubunagungamaugg, + though I've never been there myself. (word-break)

+

They say the fishing is excellent at + Lake Chargoggagoggmanchauggagoggchaubunagungamaugg, + though I've never been there myself. (hyphens, without lang attribute)

+

They say the fishing is excellent at + Lake Chargoggagoggmanchauggagoggchaubunagungamaugg, + though I've never been there myself. (hyphens, English rules)

+

They say the fishing is excellent at + Lake Chargoggagoggmanchauggagoggchaubunagungamaugg, + though I've never been there myself. (hyphens, German rules)

+``` + +#### CSS + +```css +p { width: 13em; margin: 2px; background: gold; @@ -104,41 +110,23 @@ overflow-wrap: unset; .hyphens { hyphens: auto; } -
- -

結果

+``` -

{{ EmbedLiveSample('Example', '100%', 260) }}

+#### 例 -

仕様書

+{{ EmbedLiveSample('Comparing_overflow-wrap_word-break_and_hyphens', '100%', 260) }} - - - - - - - - - - - - - - - -
仕様書状態備考
{{ SpecName('CSS3 Text', '#propdef-overflow-wrap', 'overflow-wrap') }}{{ Spec2('CSS3 Text') }}初回定義
+## 仕様書 -

{{cssinfo}}

+{{Specifications}} -

ブラウザーの互換性

+## ブラウザーの互換性 -

{{Compat("css.properties.overflow-wrap")}}

+{{Compat}} -

関連情報

+## 関連情報 - +- {{cssxref("word-break")}} +- {{cssxref("hyphens")}} +- {{cssxref("text-overflow")}} +- [テキストの分割と折り返しのガイド](/ja/docs/Web/CSS/CSS_Text/Wrapping_Text) -- cgit v1.2.3-54-g00ecf