From 70942852ffa5e35aae179533ee7874afebde4840 Mon Sep 17 00:00:00 2001 From: Masahiro FUJIMOTO Date: Sat, 17 Apr 2021 00:29:38 +0900 Subject: Web/CSS/text-decoration を更新 (#400) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Web/CSS/text-decoration を更新 - 2021/03/16 時点の英語版に同期 * Web/CSS/text-decoration-thickness を新規翻訳 2021/03/16 の英語版に基づき新規翻訳 --- .../web/css/text-decoration-thickness/index.html | 124 +++++++++++++++++++++ 1 file changed, 124 insertions(+) create mode 100644 files/ja/web/css/text-decoration-thickness/index.html (limited to 'files/ja/web/css/text-decoration-thickness/index.html') diff --git a/files/ja/web/css/text-decoration-thickness/index.html b/files/ja/web/css/text-decoration-thickness/index.html new file mode 100644 index 0000000000..63fcce1a71 --- /dev/null +++ b/files/ja/web/css/text-decoration-thickness/index.html @@ -0,0 +1,124 @@ +--- +title: text-decoration-thickness +slug: Web/CSS/text-decoration-thickness +tags: + - CSS + - CSS Text Decoration + - Property + - Reference + - 'recipe:css-property' + - text-decoration + - text-decoration-thickness +translation_of: Web/CSS/text-decoration-thickness +--- +
{{CSSRef}}
+ +

text-decoration-thicknessCSS のプロパティで、要素内のテキストに用いられる装飾線、例えば取り消し線、下線、上線の太さを設定します。

+ +

構文

+ +
/* 単独のキーワード */
+text-decoration-thickness: auto;
+text-decoration-thickness: from-font;
+
+/* 長さ */
+text-decoration-thickness: 0.1em;
+text-decoration-thickness: 3px;
+
+/* パーセント値 */
+text-decoration-thickness: 10%;
+
+/* グローバル値 */
+text-decoration-thickness: inherit;
+text-decoration-thickness: initial;
+text-decoration-thickness: unset;
+
+ +

+ +
+
auto
+
ブラウザーがテキスト装飾線の適切な太さを選択します。
+
from-font
+
フォントファイルに推奨する太さの情報が含まれている場合は、その値を使用します。フォントファイルにこの情報が含まれていない場合は、 auto が設定されているのと同様に動作し、ブラウザーが適切な太さを選択します。
+
<length>
+
テキスト装飾線の太さを {{cssxref('length')}} として指定し、フォントファイルの推奨値やブラウザーの既定値を無視します。
+
<percentage>
+
テキスト装飾線の太さを現在のフォントの 1em に対する {{cssxref('percentage')}} で指定します。パーセント値は相対値として継承されるので、フォントが変わるとそれに合わせて変わります。ブラウザーは最小でも 1 デバイスピクセルを使用しなければなりません。このプロパティを適用した場合、フォントの大きさが異なる子要素があっても、適用されたボックス全体で太さが一定になります。
+
+ +

公式定義

+ +

{{CSSInfo}}

+ +

形式文法

+ +{{csssyntax}} + +

+ +

様々な太さ

+ +

HTML

+ +
<p class="thin">赤い 1px の下線を引いたテキストです。</p>
+<p class="thick">赤い 5px の下線を引いたテキストです。</p>
+<p class="shorthand">これは同等の一括指定を使用しています。</p>
+ +

CSS

+ +
.thin {
+  text-decoration-line: underline;
+  text-decoration-style: solid;
+  text-decoration-color: red;
+  text-decoration-thickness: 1px;
+}
+
+.thick {
+  text-decoration-line: underline;
+  text-decoration-style: solid;
+  text-decoration-color: red;
+  text-decoration-thickness: 5px;
+}
+
+.shorthand {
+  text-decoration: underline solid red 5px;
+}
+ +

結果

+ +

{{ EmbedLiveSample('Varying_thickness', '', '', '') }}

+ +

仕様書

+ + + + + + + + + + + + + + + + +
仕様書状態備考
{{SpecName('CSS4 Text Decoration', '#text-decoration-width-property', 'text-decoration-width')}}{{Spec2('CSS4 Text Decoration')}}初回定義
+ +
+

: このプロパティは text-decoration-width と呼ばれていましたが、 2019 年に text-decoration-thickness に更新されました。

+
+ +

ブラウザーの互換性

+ +

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

+ +

関連情報

+ + -- cgit v1.2.3-54-g00ecf