<!DOCTYPE html>
<html>
<head>
<title>my test code</title>
<style>
#h1id {color: blue;}
h1:active {color: red;}
h3:hover {color: red;}
.h3class {color: blue;}
</style>
</head>
<body>
<h1 id="h1id">id test</h1>
<h3 class="h3class">class test</h3>
</body>
</html>
in this code
h3 selector is working but h1 selector isn't working.
Why doesn't h1 selector working? (h1:active {color: red;})
More question.
----Add my code----
1.
<!DOCTYPE html>
<html>
<head>
<title>my test code</title>
<style>
#atag {color: red;}
a:hover {color: blue;}
</style>
</head>
<body>
<a href="http://www.google.com" id="atag">a tag test</a>
</body>
</html>
2.
<style>
a {color: red;}
#atag:hover {color: blue;}
</style>
3.
<style>
a {color: red;}
a:hover {color: blue;}
</style>
4.
<style>
#atag {color: red;}
#atag:hover {color: blue;}
</style>
2, 3, 4 work very well in chrome, explorer
1 doesn't work.
Pseudo-class :hover or :active
Please let me know the reason.