我知道這已被再次提出,但我似乎面臨一個挑戰。我想要點擊或激活鏈接變成紫色,以便可以確定哪個鏈接處於活動狀態。我嘗試了幾種方法,但沒有成功。請問,任何一個?如何突出顯示活動鏈接
.nav-container {
float: center;
width: 100%;
padding-bottom: 0;
margin-bottom: 11px;
}
.navigation-menu {
padding: 0;
float: center;
clear: both;
font-size: 12px
margin-bottom: 0;
}
.navigation-menu > li {
margin-right: 3px;
margin: 100px auto;
line-height:20px;
max-width:860px;
display: inline;
}
.navigation-menu li {
list-style-type: none;
}
.navigation-menu li a {
background-color: #ffffff;
display:inline-block;
padding: 10px 20px;
color: #696969;
text-decoration: none;
border-radius: 4px 4px 0 0;
}
.navigation-menu li.active a {
background-color: purple;
color:#fff;
}
.navigation-menu li ul {
display: none;
}
.navigation-menu ul li a{
padding:10px 20px;
}
#main {
clear: left;
}
.navigation-menu li:hover ul {
display: inline-block;
position: absolute;
padding:5px;
}
.navigation-menu li ul li a:hover{
background-color: black;
color: white;
display: block;
}
.navigation-menu li a:hover{
background-color:black;
color: white;
}
<div class="nav-container">
<ul class="navigation-menu">
<li><a href='start.php'>Home</a></li>
<li><a href='pay.php'>C2B Payments</a> </li>
<li><a href='sms.php'>C2B SMS</a></li>
<li><a href='#'>B2C Payments</a>
<ul>
<li><a href="getbtc.php"> B2C Payments</a></li>
<li><a href="payment.php"> Make Payments</a></li>
</ul>
</li>
<li><a href='bsms.php'>B2C SMS</a></li>
<li><a href='index.php'>Log Out</a></li>
</ul>
</div>
如何是什麼呢?試過' .navigation-menu li.active a background-color:purple; color:#fff; '但是沒有工作 – Bob