Change div background on visited

1

I want to change the background of div , when the person is visiting that link.

I tried to use visited but it is not working.

HTML

<div class="e divFloatLeaft">
            <h:link styleClass="menu" value="Página Principal" outcome="index" />
        </div>

CSS

.e:hover {
   background-image:url(./img/fundo-laranja.jpg) !important;
   background-repeat: repeat-x;   
}

.e:visited {
   background-image:url(./img/fundo-laranja.jpg) !important;
   background-repeat: repeat-x; 
}
    
asked by anonymous 27.11.2014 / 13:19

1 answer

1

You should use .menu:visited , because this selector is used for links that have been visited, using the hyperlink address. In your example, you are using the element class div .

    
27.11.2014 / 13:22