I have come across several discussions about the :visited
pseudo-class not working anymore, especially on modern browsers. Most of these discussions are older posts.
For example, one of them can be found here: Google chrome a:visited background image not working
The post mentions that the color
attribute seems to work, but in my testing on Chrome, it does nothing. It works on IE, but loses the styling on the next click.
It must be possible somehow....I mean, Google manages to do it :))
Can anyone suggest any ideas? Maybe I missed something.
Thanks!
EDIT: This is the code snippet I am currently using:
<asp:Repeater ID="rptArrival" runat="server">
<ItemTemplate>
<div class="left">
<a id="aCityTo" runat="server" OnServerClick="lnkLink_OnCommand" cities='<%# Eval("CityCodeFrom")+"|"+ Eval("CityCodeTo") %>' >
<asp:Label runat="server" ID="Label1" Text='<%# Eval("CityNameTo") %>' CssClass="linkButtonBold"></asp:Label>
</a>
</div>
</ItemTemplate>
</asp:Repeater>
.linkButtonBold
{
font-family: Arial, Helvetica, sans-serif;
font-style: normal;
font-size: 12px;
font-weight: bold;
color: #829094;
text-decoration: none;
cursor: pointer;
}
.linkButtonBold:hover
{
text-decoration: underline;
}
.linkButtonBold:visited {
color: red;
}
I have also tried without applying the class directly to the Label and experimenting with a:hover, a:visited
, but with no success.
This is ASP.Net and C#.
Thank you for your responses.
EDIT: The generated code looks like this:
<div class="left">
<input type="hidden" name="ctl00$ContentPlaceHolder1$rptLowCost$ctl00$rptLowCostDepartures$ctl00$rptArrival$ctl00$hfCityCodeTo" id="ctl00_ContentPlaceHolder1_rptLowCost_ctl00_rptLowCostDepartures_ctl00_rptArrival_ctl00_hfCityCodeTo" value="AMS">
<a id="ctl00_ContentPlaceHolder1_rptLowCost_ctl00_rptLowCostDepartures_ctl00_rptArrival_ctl00_aCityTo" cities="CLJ|AMS" href="javascript:__doPostBack('ctl00$ContentPlaceHolder1$rptLowCost$ctl00$rptLowCostDepartures$ctl00$rptArrival$ctl00$aCityTo','')">
<span id="ctl00_ContentPlaceHolder1_rptLowCost_ctl00_rptLowCostDepartures_ctl00_rptArrival_ctl00_Label1">Amsterdam</span>
</a>
</div>
and the CSS code (I have removed the class from the Label and replaced it with your CSS): The anchor links in the horizontal menu apply the style, but those within the repeater do not:
a:visited {
color: purple;
}
a:link {
color: blue;
}