text-decorationプロパティは、文字の傍線を指定できます。
属性 | 簡易説明 |
---|---|
none | 装飾なし |
underline | 下線 |
line-through | 取り消し線 |
overline | 上線 |
underline overline | 上下線 |
underline solid 色 | 指定色の下線 |
underline double | 二重下線 |
underline dotted | 点線の下線 |
underline dashed | 破線の下線 |
underline wavy | 波線の下線 |
font-styleプロパティとtext-decorationプロパティ
<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>テキストデコレーションについて</title>
<link rel="stylesheet" href="./main.css" />
</head>
<body>
<p>text-decoration : none</p>
<p class="text-underline">text-decoration : underline</p>
<p class="text-line-through">text-decoration : line-through</p>
<p class="text-overline">text-decoration : overline</p>
<p class="text-underline-overline">text-decoration : underline overline</p>
<p class="text-underline-solid">text-decoration : underline solid 色</p>
<p class="text-underline-double">text-decoration : underline double</p>
<p class="text-underline-dotted">text-decoration : underline dotted</p>
<p class="text-underline-dashed">text-decoration : underline dashed</p>
<p class="text-underline-wavy">text-decoration : underline wavy</p>
</body>
</html>
.text-underl {text-decoration: underline}
.text-line-through {text-decoration: line-through}
.text-overline {text-decoration: overline}
.text-underline-overline {text-decoration: underline overline}
.text-underline-solid {text-decoration: underline solid red}
.text-underline-double {text-decoration: underline double}
.text-underline-dotted {text-decoration: underline dotted}
.text-underline-dashed {text-decoration: underline dashed}
.text-underline-wavy {text-decoration: underline wavy}
出力結果
text-decoration : none
text-decoration : underline
text-decoration : line-through
text-decoration : overline
text-decoration : underline overline
text-decoration : underline solid red
text-decoration : underline double
text-decoration : underline dotted
text-decoration : underline dashed
text-decoration : underline wavy