Question CSS not persisting

alander

Well-known member
Joined
Jun 26, 2007
Messages
120
Location
Singapore
Programming Experience
5-10
Hi, I have a master page with this code

VB.NET:
 <div id="menu">
                    <ul>
                        <li>
                            <asp:HyperLink ID="hypermap" runat="server" class="active" NavigateUrl="~/Default.aspx"
                                EnableViewState="true">Map</asp:HyperLink></li>
                        <li>
                            <asp:HyperLink ID="hyperSuggest" runat="server" NavigateUrl="#" EnableViewState="true">Suggest a happening</asp:HyperLink></li>
                        <li>
                            <asp:HyperLink ID="HyperCat" runat="server" NavigateUrl="#" EnableViewState="true">Categories</asp:HyperLink></li>
                        <li>
                            <asp:HyperLink ID="HyperLatest" runat="server" NavigateUrl="#" EnableViewState="true">Latest Happenings</asp:HyperLink></li>
                        <li>
                            <asp:HyperLink ID="HyperWho" runat="server" NavigateUrl="~/whorwe.aspx" EnableViewState="true">Who Are We?</asp:HyperLink></li>
                    </ul>
                         
                </div>

I have a css with this codes
VB.NET:
#menu li a
{
	margin-left: 0.5em;
	display: block;
	padding: 1.1em 1.4em 1.0em 1.4em;
	background: #fff url('img/n4.gif') repeat-x;
	border: solid 1px #fff;
	color: #616161;
	font-weight: bold;
	font-size: 1.0em;
	text-decoration: none;
}
#menu li a:visited
{
	text-decoration: none;
}
#menu li a:Hover
{
	background-position: #CA2F2F url('img/n3.gif') repeat-x;
	background: #CA2F2F url('img/n3.gif') repeat-x;
	color: #fff;
	border: solid 1px #A94B4B;
	text-decoration: none;
}

#menu li a:Active
{
	background: #CA2F2F url('img/n3.gif') repeat-x;
	color: #fff;
	border: solid 1px #A94B4B;
	text-decoration: underline;
}

However, my hover works, but when i click on the link the active does not.

The active does persist for navigateURL="#"
But it does not persist when it goes to another webcontentpage (e.g. whoarewe.aspx)

I think this have smth to do with the postback.. However, I got no idea how to fix it..

Thanks in advance
 
Last edited:

Latest posts

Back
Top