Raymond Chong
Raymond Chong

Reputation: 79

CSS visited, hover and active is not working

  a: link {
        color: #000099;
        text-decoration: none;
    }

  a: visited {
        color: #000099;
        text-decoration: none;
    }

a: hover{
    color: #33cccc;
    text-decoration: underline;
}

a: active{
    color: #000099;
    text-decoration: underline;
}

I'm using the code above in my css but only a:link is working and the rest is not.

I've already link it correctly to my html file.

I'm using sublime text 3.

Upvotes: 1

Views: 314

Answers (1)

Peter
Peter

Reputation: 624

You need to remove the spaces after the colons. The pseudo-class is always attached to the element/class/id without spaces.

a:link {
	color: #000099;
	text-decoration: none;
}

a:visited {
	color: #000099;
	text-decoration: none;
}

a:hover {
	color: #33cccc;
	text-decoration: underline;
}

a:active {
	color: #000099;
	text-decoration: underline;
}
<a href="#">Test</a>

Upvotes: 3

Related Questions