ナビゲーションメニューのホバー機能を機能させるために一生懸命努力してきましたが、色が変わらないというアイデアはありますか?
異なるリストアイテムの個別のクラスがない場合でも機能しますが、それらを異なる色にしたいのですが、ホバーするとすべて同じ色に変わります。
#container .navigationContainer .navigation
{
float: right;
margin: 44px 0 0 0;
padding: 0;
}
#container .navigationContainer .navigation ul
{
list-style: none;
}
#container .navigationContainer .navigation li.home
{
margin: 0 0 0 26px;
padding: 12px 0 0 0;
width: 156px;
display: inline;
float: left;
font: normal .75em "Times New Roman", Times, serif;
color: #369ed1;
border-top: solid 2px #369ed1;
}
#container .navigationContainer .navigation li.home a,
#container .navigationContainer .navigation li.home a:link,
#container .navigationContainer .navigation li.home a:active,
#container .navigationContainer .navigation li.home a:visited
{
color: #369ed1;
text-decoration: none;
width: 156px;
}
#container .navigationContainer .navigation li.home a:hover
{
color: #373431;
border-top: solid 2px #373431;
}
#container .navigationContainer .navigation li.about
{
margin: 0 0 0 26px;
padding: 12px 0 0 0;
width: 156px;
display: inline;
float: left;
font: normal .75em "Times New Roman", Times, serif;
color: #a6bb54;
border-top: solid 2px #a6bb54;
}
#container .navigationContainer .navigation li.about a,
#container .navigationContainer .navigation li .about a:link,
#container .navigationContainer .navigation li .about a:active,
#container .navigationContainer .navigation li .about a:visited
{
color: #a6bb54;
text-decoration: none;
width: 156px;
}
#container .navigationContainer .navigation li .about a:hover
{
color: #373431;
border-top: solid 2px #373431;
}
#container .navigationContainer .navigation li.portfolio
{
margin: 0 0 0 26px;
padding: 12px 0 0 0;
width: 156px;
display: inline;
float: left;
font: normal .75em "Times New Roman", Times, serif;
color: #df3f89;
border-top: solid 2px #df3f89;
}
#container .navigationContainer .navigation li.portfolio a,
#container .navigationContainer .navigation li .portfolio a:link,
#container .navigationContainer .navigation li .portfolio a:active,
#container .navigationContainer .navigation li .portfolio a:visited
{
color: #df3f89;
text-decoration: none;
width: 156px;
}
#container .navigationContainer .navigation li .portfolio a:hover
{
color: #373431;
border-top: solid 2px #373431;
}
#container .navigationContainer .navigation .active
{
margin: 0 0 0 26px;
padding: 12px 0 0 0;
width: 156px;
display: inline;
float: left;
font: normal .75em "Times New Roman", Times, serif;
color: #373431;
border-top: solid 2px #373431;
}
#container .navigationContainer .navigation .active a,
#container .navigationContainer .navigation .active a:link,
#container .navigationContainer .navigation .active a:active,
#container .navigationContainer .navigation .active a:visited
{
color: #373431;
text-decoration: none;
編集:
htmlコード:
<div class="navigation">
<ul>
<li class="active"><a href="index.html">Home</a></li>
<li class="about"><a href="about.html">About</a></li>
<li class="portfolio"><a href="portfolio.html">Portfolio</a></li>
</ul>
</div>