This forum is now read-only. Please use our new forums! Go to forums

0 points
Submitted by johns612
over 8 years

Why didn't my links changed when clicked, hovered?

here is my code.

a:link{
    color:#008B45;
    text-decoration: none;
}
a:hover{
    color:#00FF00;
}
a:visited{
    color:#EE9A00;
}

and here is my html code

<!DOCTYPE html>
<html>
    <head>
        <link type="text/css" rel="stylesheet" href="stylesheet.css"/>
        <title></title>
    </head>
    <body>
        <div>
            <p><a href="https://www.google.com.ph/?gfe_rd=cr&ei=uxu7VZy4PITI8AfVp7X4Ag&gws_rd=ssl">Google</a></p>
            <p><a href="https://www.facebook.com/?stype=lo&jlou=Afeqfd_rElAMOEkovwl3eM0I5gdYu-7nXarJXIbY_uWLe3Pp7ObIXRYYDCQqE2kX_DrEKFpt85iiYXU9cMUr2Fhs&smuh=45601&lh=Ac9J9lTKem4LjSqS">Facebook</a></p>
            <p><a href="https://www.youtube.com/">YouTube</a></p>
        </div>
    </body>
</html>

Answer 55bd41249113cb45200001f3

1 vote

Permalink

from http://www.w3schools.com/css/css_link.asp :

When setting the style for several link states, there are some order rules:

a:hover MUST come after a:link and a:visited a:active MUST come after a:hover

are you sure the links don’t look visited simply because you visited them? maybe try new urls?

anyway, i still can’t get past this exercise. i pasted your code and it still tells me the a:link color isn’t set.

points
Submitted by vsprs
over 8 years

1 comments

johns612 over 8 years

thanks. You’re a very resourceful person, hope we can help other more in the future.

Answer 55ba0ab8937676a9f50000fd

0 votes

Permalink

Hi Johns,

mhhh…. the CSS part looks fine. Can you show us your HTML code?

Regards, Kevin

points
Submitted by Kevin Johanning
over 8 years

1 comments

thewhiterhino over 8 years

i moved the a:visited to the top like i have below. that allowed me to see the hover color change but it was like all of the links had been clicked. a:visited { color:#ee9a00; } a:link { text-decoration: none; color:#008b45; } a:hover { color:#00ff00; }

Answer 55bc122ed3292f601d000070

0 votes

Permalink

i moved the a:visited to the top like i have below. that allowed me to see the hover color change but it was like all of the links had been clicked. The course says i got it correct. a:visited { color:#ee9a00; } a:link { text-decoration: none; color:#008b45; } a:hover { color:#00ff00; }

points
Submitted by thewhiterhino
over 8 years