在<asp:label =“”>中嵌入CSS样式,活动超链接

时间:2015-10-19 12:38:52

标签: html css asp.net

我的页面中有此代码

<div id="sidebar-menu">
                        <ul>
                             <li><asp:HyperLink ID="hyperlink_TruckData" runat="server" CssClass="" Text="Truck Data" NavigateUrl="~/View/TruckData.aspx" Font-Underline="false" style="font-size: 18px; color: black">
                                 <i class="glyphicon glyphicon-info-sign" style="color:black;"></i> 
                                 Truck Data</asp:HyperLink>
                                  </li>
                             <li><asp:HyperLink ID="hyperlink_MaintenanceRecord" runat="server"  NavigateUrl="~/View/MaintenanceRecord.aspx" Font-Underline="false" style="font-size: 18px; color: black">
                                 <i class="glyphicon glyphicon-info-sign" style="color:black"> </i>
                                     Maintenance Record</asp:HyperLink> 
                                     </li>
                             <li>
                                 <asp:HyperLink ID="hyperlink_MaintenanceSchedule" runat="server" Text="Maintenance Schedule" NavigateUrl="~/View/MaintenanceSchedule.aspx" Font-Underline="false" style="font-size: 18px; color: black">
                                     <i class="glyphicon glyph  icon-calendar" style="color:black"> </i>
                                Maintenance Schedule </asp:HyperLink>
                             </li>
                             <li>
                                 <asp:hyperlink id="hyperlink_Inspection" runat="server" text="inspection" navigateurl="~/view/inspection.aspx" font-underline="false" style="font-size: 18px; color: black">
                                 <i class="glyphicon glyphicon-calendar" style="color:black"></i>
                                Inspection </asp:hyperlink>
                             </li>
                            <li>
                                 <asp:hyperlink id="hyperlink_MaintenanceChecklist" runat="server" text="inspection" navigateurl="~/view/maintenancechecklist.aspx" font-underline="false" style="font-size: 18px; color: black">
                                 <i class="glyphicon glyphicon-calendar" style="color:black"></i>
                                Maintenance Checklist </asp:hyperlink>
                             </li>
                        </ul>
                    </div><!-- End div #sidebar-menu -->
            </div><!-- End div .body .rows .scroll-y -->
        </div>

什么样的css样式才能突出显示active?我想突出显示我点击的当前页面。我现在的css上有这个。

#sidebar-menu > ul > li > a.Link:Active{
    color: #fff;
    background: #fff;
} 

请帮帮我。

1 个答案:

答案 0 :(得分:0)

我会尝试将活动放在li元素上,这样它会覆盖整个链接:

#sidebar-menu > ul > li:Active{
    color: #fff;
    background: highlight;
}