text-decorationの使い方
Web標準HTML/CSS > text-decorationの使い方
text-decoration
プロパティの説明
text-decorationは、文字に線を引くプロパティです。ブロック要素に指定することができます。
指定できる値
- none
- 標準設定。線なしの状態にする。
- underline
- 下線を表示します。
- overline
- 上線を表示します。
- line-throuth
- 取り消し線を表示します。
サンプル
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"https://www.w3.org/TR/html4/strict.dtd">
<html lang="ja">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="Content-Style-Type" content="text/css">
<title>サンプルページ</title>
<style type="text/css">
<!--
.t1{text-decoration:underline;}
.t2{text-decoration:overline;}
.t3{text-decoration:line-through;}
.t4{text-decoration:underline overline;}
-->
</style>
</head>
<body>
<h1>サンプルページ</h1>
<p class="t1">下線を指定しています。</p>
<p class="t2">上線を指定しています。</p>
<p class="t3">取り消し線を指定しています。</p>
<p class="t4">上下線を指定しています。</p>
</body>
</html>