爲什麼導航鏈接採用正常鏈接的樣式?鏈接css不同顏色方案問題
這是一個基本的導航菜單:
<!-- Begin menu -->
<div align="center"> <span class="nav">
<a href="index.html" title="Graphic Boulevard - Home pagina">Home</a> |
<a href="autobelettering.html" title="Graphic Boulevard - Autobelettering">Autobelettering</a> |
<a href="reclame.html" title="Graphic Boulevard - Binnen reclame en Buiten reclame">Reclame</a> |
<a href="prints.html" title="Graphic Boulevard - Groot formaat printen">Prints</a> |
<a href="textiel.html" title="Graphic Boulevard - Textiel bedrukken">Textiel</a> |
<a href="ontwerpen.html" title="Graphic Boulevard - Ontwerpen">Ontwerpen</a> |
<a href="aanleveren.html" title="Graphic Boulevard - Digitale bestanden aanleveren">Aanleveren</a> |
<a href="contact.html" title="Graphic Boulevard - Neem contact met ons op.">Contact</a>
</span><br />
</div>
<!-- Einde Menu -->
這是CSS
/* Normal links */
a {
font-size: 12px;
color: #DC342F;
}
a:link {
text-decoration: none;
color: #DC342F;
}
a:visited {
text-decoration: none;
color: #DC342F;
}
a:hover {
text-decoration: underline;
color: #DC342F;
}
a:active {
text-decoration: none;
color: #DC342F;
}
/* navigation links */
a.nav {
text-decoration: none;
color: #FFFFFF;
font-weight: bold;
font-size: 14px;
}
a.nav:visited {
text-decoration: none;
color: #FFFFFF;
font-weight: bold;
font-size: 14px;
}
a.nav:hover {
text-decoration: none;
color: #DFFFFFF;
font-weight: bold;
font-size: 14px;
}
a.nav:active {
text-decoration: none;
color: #FFFFFF;
font-weight: bold;
font-size: 14px;
}
原因是,他們是一個「a」類標籤,在類「nav」的範圍內。 「a.nav」會選擇自己擁有「nav」類的「a」標籤。 – Kev 2009-10-15 14:17:32
太棒了!謝謝你們的快速響應。 – Chris 2009-10-15 14:28:01
任何時候都沒有問題。 :) – Kev 2009-10-15 14:28:54