navigation buttons on mouseover with css

i am trying to create a navigation with the following CSS

the issue is that i want the links to have a certain font-family, font-size, & font color

the background is changing like i want with the opacity,
but the links should be a lime green and change to a bright
they are not changing and they are becoming opac as with the background

anyone know how to change this to work right?

here is the link to what i have:
http://myblankweb.com/opac.html


thanks
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
<html xmlns="http://www.w3.org/1999/xhtml"> 
 
<head> 
<meta http-equiv="Content-Language" content="en-us" /> 
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 
<title>opacity nav</title> 
 
<style> 
 
.nav:link      { color:#99CC00; text-decoration:none ; font-family:Arial, Helvetica, sans-serif; font-size:15pt;  }
.nav:visited   { color:#99CC00; text-decoration:none ; font-family:Arial, Helvetica, sans-serif; font-size:15pt;  }
.nav:active    { color:#99CC00; text-decoration:none ; font-family:Arial, Helvetica, sans-serif; font-size:15pt;  }
.nav:hover     { color:#99CC00; text-decoration:none ; font-family:Arial, Helvetica, sans-serif; font-size:15pt; background-color:#CCCCCC; filter:alpha(opacity=70); opacity:0.7;  }
 
 
</style> 
 
 
</head> 
 
<body style="margin: 0px; background-image: url('images/bg.png');"> 
 
<table style="width: 100%; height:65px; background-color:#999999; filter:alpha(opacity=50); opacity:0.5;" cellpadding="0" cellspacing="0" align="center"> 
<tr> 
<td> 
 
<table style="width: 975px;height:65px" cellpadding="0" cellspacing="0" align="center"> 
<tr> 
<td class="nav" style="text-align: center"> 
<a href="opac.html">hello</a></td> 
<td class="nav" style="text-align: center"><a href="opac.html">hello</a></td> 
</tr> 
</table> 
 
</td> 
</tr> 
</table> 
 
</body> 
 
</html>

Open in new window

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
<html xmlns="http://www.w3.org/1999/xhtml"> 
 
<head> 
<meta http-equiv="Content-Language" content="en-us" /> 
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 
<title>opacity nav</title> 
 
<style> 
 
.nav:link      { color:#99CC00; text-decoration:none ; font-family:Arial, Helvetica, sans-serif; font-size:15pt;  }
.nav:visited   { color:#99CC00; text-decoration:none ; font-family:Arial, Helvetica, sans-serif; font-size:15pt;  }
.nav:active    { color:#99CC00; text-decoration:none ; font-family:Arial, Helvetica, sans-serif; font-size:15pt;  }
.nav:hover     { color:#99CC00; text-decoration:none ; font-family:Arial, Helvetica, sans-serif; font-size:15pt; background-color:#CCCCCC; filter:alpha(opacity=70); opacity:0.7;  }
 
 
</style> 
 
 
</head> 
 
<body style="margin: 0px; background-image: url('images/bg.png');"> 
 
<table style="width: 100%; height:65px; background-color:#999999; filter:alpha(opacity=50); opacity:0.5;" cellpadding="0" cellspacing="0" align="center"> 
<tr> 
<td> 
 
<table style="width: 975px;height:65px" cellpadding="0" cellspacing="0" align="center"> 
<tr> 
<td class="nav" style="text-align: center"> 
<a href="opac.html">hello</a></td> 
<td class="nav" style="text-align: center"><a href="opac.html">hello</a></td> 
</tr> 
</table> 
 
</td> 
</tr> 
</table> 
 
</body> 
 
</html>

Open in new window

webdottAsked:
Who is Participating?
 
Ryan SmithConnect With a Mentor Sr. Systems EngineerCommented:
the link, visited, hover and active have to be in that order.  when using class= use a div tag.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<head>
<meta http-equiv="Content-Language" content="en-us" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>opacity nav</title>

<style>
.nav:link      { color:#99CC00; text-decoration:none ; font-family:Arial, Helvetica, sans-serif; font-size:15pt;  }
.nav:visited   { color:#99CC00; text-decoration:none ; font-family:Arial, Helvetica, sans-serif; font-size:15pt;  }
.nav:hover     { color:#000000; text-decoration:none ; font-family:Arial, Helvetica, sans-serif; font-size:15pt; background-color:#CCCCCC; filter:alpha(opacity=70); opacity:0.7;  }
.nav:active    { color:#000000; text-decoration:none ; font-family:Arial, Helvetica, sans-serif; font-size:15pt;  }



</style>


</head>

<body style="margin: 0px; background-image: url('images/bg.png');">

<table style="width: 100%; height:65px; background-color:#999999; filter:alpha(opacity=50); opacity:0.5;" cellpadding="0" cellspacing="0" align="center">
<tr>
<td>

<table style="width: 975px;height:65px" cellpadding="0" cellspacing="0" align="center">
<tr>
<td style="text-align: center">
<a href="opac.html"><div class=nav>hello</div></a></td>
<td style="text-align: center"><div class=nav><a href="opac.html">hello</a></div></td>
</tr>
</table>

</td>
</tr>
</table>

</body>

</html>

Open in new window

0
 
Ryan SmithSr. Systems EngineerCommented:
of couse put the div before the anchor tags :)
0
 
webdottAuthor Commented:
thanks, but i still have the same thing going on. the font style, color, size is still not correct and
when i mouseover they font becomes opac with the background
0
 
Dave BaldwinConnect With a Mentor Fixer of ProblemsCommented:
The 'pseudo-class' are used with 'a' for anchor.  http://www.w3schools.com/css/css_pseudo_classes.asp  The order is important, 'active' must come after 'hover'.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
<html xmlns="http://www.w3.org/1999/xhtml"> 
 
<head> 
<meta http-equiv="Content-Language" content="en-us" /> 
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 
<title>opacity nav</title> 
 
<style> 
 
.nav a:link      { color:#99CC00; text-decoration:none ; font-family:Arial, Helvetica, sans-serif; font-size:15pt;  }
.nav a:visited   { color:#99CC00; text-decoration:none ; font-family:Arial, Helvetica, sans-serif; font-size:15pt;  }
.nav a:hover     { color:#99CC00; text-decoration:none ; font-family:Arial, Helvetica, sans-serif; font-size:15pt; background-color:#CCCCCC; filter:alpha(opacity=70); opacity:0.7;  }
.nav a:active    { color:#99CC00; text-decoration:none ; font-family:Arial, Helvetica, sans-serif; font-size:15pt;  }
 
 
</style> 
 
 
</head> 
 
<body style="margin: 0px; background-image: url('images/bg.png');"> 
 
<table style="width: 100%; height:65px; background-color:#999999; filter:alpha(opacity=50); opacity:0.5;" cellpadding="0" cellspacing="0" align="center"> 
<tr> 
<td> 
 
<table style="width: 975px;height:65px" cellpadding="0" cellspacing="0" align="center"> 
<tr> 
<td class="nav" style="text-align: center"> 
<a href="opac.html">hello</a></td> 
<td class="nav" style="text-align: center"><a href="opac.html">hello</a></td> 
</tr> 
</table> 
 
</td> 
</tr> 
</table> 
 
</body> 
 
</html>

Open in new window

0
 
webdottConnect With a Mentor Author Commented:
Thanks for all the help. I did make a mistake with the order of the link styles, but the opacity
issue still existed on the links making them opac as well.

I ended up having to create 2 opac .png images that would change when moused over
to create what i wanted. I am going to reward points to both due to the "psuedo-class" order.

They both would work if I did not want to have links or text in the picture.

Below is the code that I finally used. Remember, that I used Transparent Opac images to create this.
The navon.png is just a transparent image with a gray of 50% opacity.
The navonON.png is also a transparent image with a gray of 70% opacity.

I did not use the psuedo-class for my site because I ended up having the colors change on mouseover,
but i included it in the first link just in case someone wanted to see how to do that instead.
I would not recommend using it because it is just code not needed, you could save that
for your links in the page instead, but that is up to them.

thanks again

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">















                        
                                                
                                                Link
                                                
                                                two
                                                
                                                three
                                                
                                                four
                                                
                                                five
                        











<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<head>
<meta http-equiv="Content-Language" content="en-us" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />


<style type="text/css">

.nav		   { 
				background-image:url('images/navon.png'); 
				background-repeat:repeat-x; 
				font-family:Arial, Helvetica, sans-serif; 
				font-size:15pt; 
				font-weight:bold; 
				color:#FFFFFF
				}
.nav:hover     { 
				background-image:url('images/navonON.png'); 
				background-repeat:repeat-x;
				font-family:Arial, Helvetica, sans-serif; 
				font-size:15pt; 
				font-weight:bold; 
				color:#000000}

a   {color: #FFFFFF; text-decoration:none}
a:visited {color: #FFFFFF; text-decoration:none}
a:active {color: #FFFFFF; text-decoration:none}
a:hover {color: #E8FFD9; text-decoration:none}

</style>


</head>

<body style="background-color: #6698C1">

<table style="width: 625px; height: 65px" cellpadding="0" cellspacing="0" align="center" >
				<tr>
								<td class="nav" onClick=location.href="default.htm" style=" width:125px" align="center">
								<a href="default.htm">Link</a></td>
								<td class="nav" onClick=location.href="default.htm" style=" width:125px" align="center">
								two</td>
								<td class="nav" onClick=location.href="default.htm" style=" width:125px" align="center">
								three</td>
								<td class="nav" onClick=location.href="default.htm" style=" width:125px" align="center">
								four</td>
								<td class="nav" onClick=location.href="default.htm" style=" width:125px" align="center">
								five</td>
				</tr>
</table>




</body>

</html>

Open in new window

0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.