Search code examples
javascripthtmlcssinternet-explorer-11

Visited links not changing color in IE11


I have the CSS below affecting news entries automatically populated through javascript, and :visited is not persisting through page refresh on IE(any version), but is persisting on Chrome/FF. Does anyone know why IE would have issues retaining visited attribute?

.Hyperlinks:visited {
    color:#2c3c4f!important;
}

.Hyperlinks:hover {
    color:#f39b13!important;
}

The HTML it is affecting:

<div class='panel' style='margin:0; padding-left: 10px; background:white; color:#0072C5'>
<h4 style='margin-bottom:0; padding-left:0px; font-weight:bold; font-size:20px; color:#0072C5' id='newsTitle'>
<a class='Hyperlinks' style='color:blue;' target='_blank' href='my_link_here'></a></h4>
<p></p></div>

Solution

  • Turns out that the reason was not the CSS or HTML at all, but rather than the Hyperlink was making a small redirect. So when you travel to the link, Chrome and Firefox must have recorded both the pre and post redirect links, whereas Internet Explorer does not, so that link would show up as having never been visited.