タイポグラフィ(デザイン)

text-decoration-line

傍線を設定する

valuedescription
none傍線なしTokyo Olympics
underline下線Tokyo Olympics
overline上線Tokyo Olympics
line-through打ち消し線Tokyo Olympics
underline line-through下線 + 打ち消し線Tokyo Olympics

Demo

The Tokyo Olympics were held in 2021.

The Tokyo Olympics were held in 2021.

The Tokyo Olympics were held in 2021.

The Tokyo Olympics were held in 2021.

The Tokyo Olympics were held in 2021.

<p>The <span>Tokyo Olympics</span> were held in 2021.</p>
<p>The <span class="style-1">Tokyo Olympics</span> were held in 2021.</p>
<p>The <span class="style-2">Tokyo Olympics</span> were held in 2021.</p>
<p>The <span class="style-3">Tokyo Olympics</span> were held in 2021.</p>
<p>The <span class="style-4">Tokyo Olympics</span> were held in 2021.</p>
.style-1 {
  text-decoration-line: underline;
}
.style-2 {
  text-decoration-line: overline;
}
.style-3 {
  text-decoration-line: line-through;
}
.style-4 {
  text-decoration-line: underline line-through;
}

概要

下線打ち消し線などを設定することができます。複数の値をスペース区切りで設定することもできます。

通常はtext-decorationプロパティで、傍線に関する値をまとめて設定することが多いです。

関連

参照

  • 参照