我正在製作一個CSS導航欄,它存儲在名爲'includes'的文件夾中。基本上我想要的是,當一個鏈接被點擊時,它會變得活躍。我用「include('includes/header.php')鏈接到這個文件夾;」使用PHP的CSS導航包括
我的CSS是:
nav ul li a {
font-size:22px;
color:#fff;
height:67px;
line-height:67px;
text-decoration:none;
min-width:101px;
text-align:center;
float:left;
background: grey;
border-right:1px solid black;}
nav ul li a.current, nav ul li a:hover {padding-bottom:5px;}
header.php文件的內容是:
<header>
<div class="container">
<nav>
<ul>
<li><a href="index.php">Home</a></li>
<li><a href="services.php">Services</a></li>
<li><a href="#">Blog</a></li>
<li><a href="/forum/index.php">Forums</a></li>
<li><a href="contact.php">Contact</a></li>
<li><a href="#">Account</a></li>
</ul>
</nav>
如何去使用這個方法,每次點擊鏈接都會激活?
你能分享一下您的HEA的內容der.php代碼? – Dragony
FictionSolutions