text-decoration: none;
text-decoration は、文字の装飾(下線、上線、取り消し線、点滅)を指定するプロパティです。
a要素に対してこのプロパティ(値 none)を設定すると、リンクテキストの下線を消すことができます。
a {
text-decoration: none;
}
プロパティ名 | 値 | 説明 |
---|---|---|
text-decoration | none | 装飾なし (下線を消す) |
下線を消してしまうと、リンク部分が判別しにくくなってしまう場合があります。本文中のリンクなどは、下線を消さないことをお勧めします。
使用例
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>文書のタイトル</title>
<style type="text/css">
a { text-decoration: none; }
</style>
</head>
<body>
<p><a href="index.html">リンクカテゴリー</a></p>
</body>
</html>
表示例
- サイト内検索