我遇到了Color屬性的問題,我試圖將其應用於菜單li
定位標記。CSS顏色屬性
li a:visited {color:red;}
和li a.selected {color:green;}
正確應用,但是li a{color:blue;}
沒有被應用。
http://www.virtualpetstore.com
這個類定義的未施加藍色:
.solidblockmenu li a {
float: left;
color: blue;
font-family:Arial Black;
font-size:12px;
padding: 8px 20px 8px 20px;
text-decoration: none;
border-right: 1px solid white;
}
這是菜單的標記:
<div id="menu2">
<asp:LoginView ID="HeadLoginView" runat="server" EnableViewState="false">
<AnonymousTemplate>
<ul id="solidmenu" class="solidblockmenu">
<li><a href="~/default.aspx" runat="server">Incinio</a></li>
<li><a href="~/empresa.aspx" runat="server">Empresa</a></li>
<li><a href="~/webgrupodotnet.aspx" runat="server">Deserollo</a></li>
<li><a href="~/webgrupodiseno.aspx" runat="server">Diseno</a></li>
<li><a href="~/webgrupomovil.aspx" runat="server">Moviles</a></li>
<li><a href="~/asociados.aspx" runat="server">Asociados</a></li>
<li><a href="~/contacto.aspx" runat="server">Contacto</a></li>
<li><a href="~/Account/Registrar.aspx" id="Registrar" runat="server">Registrar</a></li>
<li><a href="~/Account/Login.aspx" id="HeadLogin" runat="server">Log-In</a></li>
</ul>
</AnonymousTemplate>
<LoggedInTemplate>
<ul id="solidmenu" class="solidblockmenu">
<li><a href="~/default.aspx" runat="server">Incinio</a></li>
<li><a href="~/empresa.aspx" runat="server">Empresa</a></li>
<li><a href="~/webgrupodotnet.aspx" runat="server">Deserollo</a></li>
<li><a href="~/webgrupodiseno.aspx" runat="server">Diseno</a></li>
<li><a href="~/webgrupomovil.aspx" runat="server">Moviles</a></li>
<li><a href="~/asociados.aspx" runat="server">Asociados</a></li>
<li><a href="~/contacto.aspx" runat="server">Contacto</a></li>
<li><span style="width: 25px;">
<asp:LoginStatus ID="headloginstatus" runat="server" LogoutAction="redirect" LogoutText="log out" LogoutPageUrl="~/" />
</span>
</li>
<li><span>
<a href="/Account/ModificarCuenta.aspx" class="modifyuser">
<asp:LoginName ID="headloginname" runat="server" />
</a>
</span>
</li>
</ul>
</LoggedInTemplate>
</asp:LoginView>
</div>
這裏是剩餘ddmenu.css:
.solidblockmenu {
margin: 0 0 0 0;
padding: 0 0 0 0;
float: left;
font: bold 13px Arial;
overflow: hidden;
margin-bottom: 1em;
border: 1px solid #625e00;
border-width: 1px 0;
background: black url("http://i.imgur.com/iTqzs.gif") center center repeat-x;
}
.solidblockmenu li {
display: inline;
}
.solidblockmenu li a {
float: left;
color: blue;
font-family:Arial Black;
font-size:12px;
padding: 8px 20px 8px 20px;
text-decoration: none;
border-right: 1px solid white;
}
.solidblockmenu li a:visited {
color: Red;
}
.solidblockmenu li a:hover, .solidblockmenu li a.selected {
color: Green;
background: transparent url("http://i.imgur.com/mjYcj.gif") center center repeat-x;
position: relative;
}
你嘗試的藍色深淺等了嗎? – Hardryv 2012-03-27 16:53:09
請僅在您的問題上發佈相關的代碼? – Starx 2012-03-27 16:53:13
您是否嘗試過使用RGB值?喜歡'顏色:#00F' – 2012-03-27 16:54:58