CSS selector a: link: hover

I am trying to create my site so that you can indicate where you are, only by the color of the elements in each div. A website is only one page, and I use jQuery to cut sections of a website when you click to open that section (as opposed to having separate .html).

To show them in which section they are open, I make all the links in each section of the same color as the text that opens this section. However, I also want to have tags <a> </a>that are not links in order to add some color to the site and attract viewers to the key bits of information. For this reason, I want to apply link effects only to tags <a> </a>that are actually links ... So, I tried this:

#box1 a{
    color: #68cff2;
}

#box1 a:link:hover{
    color: #ffffff;
    background-color: #68cff2;
}

This works for the background color, since it only changes the background color for <a> </a>one that has href = "...", but it does not change the font color for such links ... is there any way to sort this?

+5
source share
2 answers

The class pseudo-class :linkapplies only to invisible links, unlike all links. Remember that you also visited account links. You may need to repeat the selector for the links visited, as I notice that you did not:

#box1 a:link:hover, #box1 a:visited:hover {
    color: #ffffff;
    background-color: #68cff2;
}

(or just use more#box1 a[href]:hover instead )

, , <a> , , , , " ". , . <em> <strong>, , , , :

#box1 a, #box1 em {
    font-style: normal;
    color: #68cff2;
}

#box1 a:hover{
    color: #ffffff;
    background-color: #68cff2;
}

- :link :visited, , <a> .

+7

a:link:hover{}? a:hover {}

+2

All Articles