Forum Moderators: not2easy
h3 {
font-size: 36px;
color: red;
margin: 0px;
padding: 0px;
text-align: center;
}
h3 a:link {
color: red;
}
h3 a:visited {
color: red;
}
h3 a:hover {
color: black;
}
1) The <h3> is not a link, but presumably contains a link.
It is only black on :hover - as specified.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title></title>
<meta http-equiv="content-style-type" content="text/css" />
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<style type="text/css" media="screen">
h3 {
font-size: 36px;
color: red;
margin: 0;
padding: 0;
text-align: center;
}
h3 a:link {
color: red;
}
h3 a:visited {
color: red;
}
h3 a:hover {
color: black;
}
</style>
</head>
<body>
<h3>
<a href="http://www.example.com">LINK</a>
</h3>
<!--##########
i have an H3 that is also a hyperlink. Although the h3 is coded in my CSS to turn red, when i add them hyperlink to it, it turns black. how do i keep it red? i tried the below css but that didnt work. please advise.
-->
</body>
</html>
Easiest to find it is to use e.g. the web developer toolbar in Firefox, and use the CSS/View style information to click on such an element and see what CSS it gets from where.