サイト内検索

...スタイルシート(css)...

スタイルシート・リンク

ポイントしたときに下線を表示する

ポイントしたときに下線を表示するには、
疑似クラス(:hover)を指定したa要素に、text-decorationプロパティを指定します。
ポイントしたときに下線を表示する場合には、下線を消しておきます。
[使い方]
a {
text-decoration: none;
}
a:hover {
text-decoration: underline;
}
プロパティ名 説明
text-decoration: underline;下線を表示します
文字を装飾するには、「テキスト・文字の装飾」をご覧ください。

ポイントしたときに下線を消す

ポイントしたときに下線を消すには、
疑似クラス(:hover)を指定したa要素に、text-decorationプロパティを指定します。
上線・下線・抹消線・点滅させたりするときに指定します。
[使い方]
a:hover {
text-decoration: none;
}
プロパティ名 説明
text-decoration: none;下線を消します。
文字を装飾するには、「テキスト・文字の装飾」をご覧ください。

サンプル

[headの中]

<style type="text/css">
<!--
a{
text-decoration: none;
}
a:hover { text-decoration: underline;
color: #c9171e;
}
-->
</style>

[bodyの中]

<a href="../../sample.html">ポイントしたときに下線が表示されます。</a>

[ブラウザ上]

ポイントしたときに下線が表示されます。


Copyright c 2007.10.01 luc All rights reserved.