文字の装飾を指定する


text-decoration: ***;

ブラウザ
Internet Explorer Netscape Firefox Opera
参考
書式基本 要素名 クラス ID

text-decoration は、文字の装飾(上線、下線、抹消線、点滅)を指定するプロパティです。


p {
text-decoration: underline;
}


text-decoration underline … (下線)Internet ExplorerNetscapeFirefoxOpera
overline … (上線)Internet ExplorerNetscape6FirefoxOpera
line-through … (抹消線)Internet ExplorerNetscapeFirefoxOpera
blink … (点滅)NetscapeNetscape7FirefoxOpera
none … (指定なし)デフォルト

複数の値を同時に指定する場合は、半角スペースで区切って記述します。

text-decoration: underline overline;

【参考】

次のように指定すると、下線付きの文字(a)を下線なしで表示することができます。

a {
text-decoration: none;
}


使用例

<html>
<head>
<title>TAG index Webサイト</title>

<style type="text/css">
<!--

#example1 { text-decoration: underline; }
#example2 { text-decoration: overline; }
#example3 { text-decoration: line-through; }
#example4 { text-decoration: blink; }
#example5 { text-decoration: underline overline; }


-->
</style>

</head>
<body>

<p id="example1">下線を指定</p>
<p id="example2">上線を指定</p>
<p id="example3">抹消線を指定</p>
<p id="example4">点滅を指定</p>
<p id="example5">上下線を指定</p>

</body>
</html>

これをブラウザで見ると次のように表示されます

下線を指定

上線を指定

抹消線を指定

点滅を指定

上下線を指定



[特集] レンタルサーバー比較 & サーバー選びのチェックポイント
[統計] HTMLからXHTMLへの移行を進めていますか?