NN Factory
> HTML Tips> リンク


リンクの下線を消す
 リンク部分の下線を表示させないようにするにはスタイルシートで指定します。
 
 サンプル   普通のリンクはこうなります。
 
 サンプル    下線を消す

<a href="sample.htm" style="text-decoration:none">サンプル</a>
 
 
 
 
 
リンクの背景色を変える
 カーソルを当てるとリンク部分の背景色が変わります。
 
 サンプル  
 
  タグの中に挿入する方法

<a href="sample.htm"style="text-decoration:none "onmouseover="this.style.background='#D2E8E8'" onmouseout="this.style.background=''"">サンプル</a>
 
 

  スタイルシートで指定<HEAD>〜</HEAD>の中に挿入する方法
<head>
<style type="text/css">
<!--
a:link{color: #666666; text-decoration:none;}
a:visited{color:#666666; text-decoration:none;}
a:hover{color: #666666; text-decoration:none; background: #D2E8E8;}
a:active{color: #666666; text-decoration:none ;}
-->
</style>
</head>
 
 ↑サンプルページのリンクのスタイルシートの指定です。
 
  スタイルシートは別ファイルにするのがベストです。
  <HEAD>〜</HEAD>の中に一行挿入します。

<link rel="stylesheet" href="style.css" >
 
 
<<BACK  NEXT>>