From a8026efcd3bbf9ac82b6dc432fb5b5ea08af3126 Mon Sep 17 00:00:00 2001 From: Masahiro FUJIMOTO Date: Fri, 8 Oct 2021 01:42:14 +0900 Subject: CSS テキスト装飾の各プロパティの文書を更新 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 2021/10/04 時点の英語版に同期 --- files/ja/web/css/text-decoration/index.md | 161 +++++++++++++----------------- 1 file changed, 68 insertions(+), 93 deletions(-) (limited to 'files/ja/web/css/text-decoration') diff --git a/files/ja/web/css/text-decoration/index.md b/files/ja/web/css/text-decoration/index.md index 8e77aba241..4f93ab28ee 100644 --- a/files/ja/web/css/text-decoration/index.md +++ b/files/ja/web/css/text-decoration/index.md @@ -6,62 +6,68 @@ tags: - CSS Property - CSS Text Decoration - Reference - - 'recipe:css-shorthand-property' - - text-decoration - - text-decoration-color - - text-decoration-line - - text-decoration-style + - recipe:css-shorthand-property +browser-compat: css.properties.text-decoration translation_of: Web/CSS/text-decoration --- -
{{CSSRef}}
+{{CSSRef}} -

text-decorationCSS一括指定プロパティで、テキストの装飾的な線の表示を設定します。これは {{cssxref("text-decoration-line")}}, {{cssxref("text-decoration-color")}}, {{cssxref("text-decoration-style")}} およびさらに新しい {{cssxref("text-decoration-thickness")}} プロパティの一括指定です。

+**`text-decoration`** は [CSS](/ja/docs/Web/CSS) の[一括指定](/ja/docs/Web/CSS/Shorthand_properties)プロパティで、テキストの装飾的な線の表示を設定します。これは {{cssxref("text-decoration-line")}}、{{cssxref("text-decoration-color")}}、{{cssxref("text-decoration-style")}} およびさらに新しい {{cssxref("text-decoration-thickness")}} プロパティの一括指定です。 -
{{EmbedInteractiveExample("pages/css/text-decoration.html")}}
+{{EmbedInteractiveExample("pages/css/text-decoration.html")}} -

文字列の装飾は、子孫の文字列要素に適用されます。つまり、要素に文字列装飾が指定されれば、子要素では装飾を外すことができません。例えば、 <p>This text has <em>some emphasized words</em> in it.</p> というマークアップと、 p { text-decoration: underline; } のスタイル規則では、段落全体に下線が引かれます。 em { text-decoration: none; } のスタイル規則を適用しても変化せず、段落全体に下線が引かれたままになります。しかし、 em { text-decoration: overline; } の規則で "some emphasized words" に第二の装飾が施されます。

+文字列の装飾は、子孫の文字列要素に適用されます。つまり、要素に文字列装飾が指定されれば、子要素では装飾を外すことができません。例えば、`

This text has some emphasized words in it.

` というマークアップと、 `p { text-decoration: underline; }` のスタイル規則では、段落全体に下線が引かれます。 `em { text-decoration: none; }` のスタイル規則を適用しても変化せず、段落全体に下線が引かれたままになります。しかし、 `em { text-decoration: overline; }` の規則で "some emphasized words" に第二の装飾が施されます。 -

構成要素のプロパティ

+## 構成要素のプロパティ -

このプロパティは以下の CSS プロパティの一括指定です。

+このプロパティは以下の CSS プロパティの一括指定です。 - +- [`text-decoration-color`](/ja/docs/Web/CSS/text-decoration-color) +- [`text-decoration-line`](/ja/docs/Web/CSS/text-decoration-line) +- [`text-decoration-style`](/ja/docs/Web/CSS/text-decoration-style) +- [`text-decoration-thickness`](/ja/docs/Web/CSS/text-decoration-thickness) -

構文

+## 構文 -

text-decoration プロパティは、個別指定の text-decoration プロパティを表す 1 つまたは複数の値を空白で区切って指定します。

+```css +text-decoration: underline; +text-decoration: overline red; +text-decoration: none; -

+/* グローバル値 */ +text-decoration: inherit; +text-decoration: initial; +text-decoration: revert; +text-decoration: unset; +``` -
-
{{cssxref("text-decoration-line")}}
-
使用する装飾の種類を設定します。 underlineline-through などです。
-
{{cssxref("text-decoration-color")}}
-
装飾の色を設定します。
-
{{cssxref("text-decoration-style")}}
-
装飾に使用する線のスタイルを設定します。 solid, wavy, dashed などです。
-
{{cssxref("text-decoration-thickness")}}
-
装飾に使われる線の太さを設定します。
-
+`text-decoration` プロパティは、個別指定の text-decoration プロパティを表す 1 つまたは複数の値を空白で区切って指定します。 -

公式定義

+### 値 -

{{CSSInfo}}

+- {{cssxref("text-decoration-line")}} + - : 使用する装飾の種類を設定します。 `underline` や `line-through` などです。 +- {{cssxref("text-decoration-color")}} + - : 装飾の色を設定します。 +- {{cssxref("text-decoration-style")}} + - : 装飾に使用する線のスタイルを設定します。 `solid`, `wavy`, `dashed` などです。 +- {{cssxref("text-decoration-thickness")}} + - : 装飾に使われる線の太さを設定します。 -

形式文法

+## 公式定義 + +{{CSSInfo}} + +## 形式文法 {{csssyntax}}

-

text-decoration の値のデモ

+### text-decoration の値のデモ -
.under {
+```css
+.under {
   text-decoration: underline red;
 }
 
@@ -88,64 +94,33 @@ translation_of: Web/CSS/text-decoration
 .blink {
   text-decoration: blink;
 }
-
+``` -
<p class="under">This text has a line underneath it.</p>
-<p class="over">This text has a line over it.</p>
-<p class="line">This text has a line going through it.</p>
-<p>This <a class="plain" href="#">link will not be underlined</a>,
+```html
+

This text has a line underneath it.

+

This text has a line over it.

+

This text has a line going through it.

+

This link will not be underlined, as links generally are by default. Be careful when removing the text decoration on anchors since users often depend on - the underline to denote hyperlinks.</p> -<p class="underover">This text has lines above <em>and</em> below it.</p> -<p class="thick">This text has a really thick purple underline in supporting browsers.</p> -<p class="blink">This text might blink for you, - depending on the browser you use.</p> -

- -

{{EmbedLiveSample('Examples','auto','320')}}

- -

仕様書

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
仕様書状態備考
{{SpecName('CSS4 Text Decoration')}}{{Spec2('CSS4 Text Decoration')}}{{cssxref("text-decoration-thickness")}} を追加。なお、これはまだ公式には一括指定の一部ではありません。これはまだ未定義です。
{{SpecName('CSS3 Text Decoration', '#text-decoration-property', 'text-decoration')}}{{Spec2('CSS3 Text Decoration')}}一括指定プロパティへ変更。 {{cssxref('text-decoration-style')}} の値への対応を追加。
{{SpecName('CSS2.1', 'text.html#lining-striking-props', 'text-decoration')}}{{Spec2('CSS2.1')}}実質的な変更なし。
{{SpecName('CSS1', '#text-decoration', 'text-decoration')}}{{Spec2('CSS1')}}初回定義
- -

ブラウザーの互換性

- -

{{Compat("css.properties.text-decoration")}}

- -

関連情報

- - + the underline to denote hyperlinks.

+

This text has lines above and below it.

+

This text has a really thick purple underline in supporting browsers.

+ +``` + +{{EmbedLiveSample('Examples','auto','320')}} + +## 仕様書 + +{{Specifications}} + +## ブラウザーの互換性 + +{{Compat}} + +## 関連情報 + +- text-decoration の個別指定プロパティは、 {{cssxref("text-decoration-line")}}、{{cssxref("text-decoration-color")}}、{{cssxref("text-decoration-style")}} です。 +- {{cssxref("list-style")}} 属性は HTML の {{HTMLElement("ol")}} および {{HTMLElement("ul")}} のリストの表示方法を制御します。 -- cgit v1.2.3-54-g00ecf