0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

hover擬似クラス

0
Posted at

:hover カーソルなどが乗った際のスタイルを指定します。
    a:hoverでは“カーソルは乗っているがクリックはされていない状態”です。
:active 要素がアクティブになった際のスタイルを指定します。
    a:activeでは“クリックされてから離されるまでの状態”です。

HPのサンプル作成
↓一部

HTML
<div class="navi">
			<ul>
				<li><a href="#">トップページ<br><span>Top</span></a></li>
				<li><a href="#">ごあいさつ<br><span>Greeting</span></a></li>
				<li><a href="#">サービス概要<br><span>Service</span></a></li>
				<li><a href="#">弊社の取り組み<br><span>Approach</span></a></li>
				<li><a href="#">会社情報<br><span>Company</span></a></li>
				<li><a href="#">お問い合わせ<br><span>Contact</span></a></li>
			</ul>
		</div>
CSS
.navi{
	width:100%;
	height:50px;
	background:#f1f1f1;
}
.navi:after{
	content:"";display:block;clear:both;
}
.navi ul{
	width:930px;
	margin:0px auto 0px auto;
	padding:0px;
}
.navi ul li{
	float:left;
	width:16.5%;
	height:50px;
	font-size:12px;
	text-align:center;
	background:#eeeeee;
	list-style-type: none
}
.navi ul li a{
	width:100%;
	height:45px;
	padding-top:5px;
	display:block;
	text-decoration:none;
}
.navi ul li a:hover{
	color:#fff;
	background-color:#ccc;
}
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?