Hey, I am trying to do some CSS rollover things on my navigation bar. Here is my code:
Now the problem is that when you hover over the link the background changes perfectly but the text ends up being at the top of the image and not valigned in the middle height. I have tried padding-top but that just makes everything worse. So any ideas?
Thanks for your help.
| Code: |
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html> <head> <title>Untitled Document</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <style type="text/css"> *{ margin:0px; padding:0px: } body{ font-family: 5x5; font-size: 10px; } #container{ width: 790px; margin-left: auto; margin-right: auto; border: 1px solid #000000; } #header{ width: 790px; height: 72px; border-bottom: 1px solid #FFFFFF; margin-left: auto; margin-right: auto; } #navigation{ width: 790px; height: 49px; background: url('images/navigation.gif'); margin-left: auto; margin-right: auto; } #navigation td{ border-left: 1px solid #8299a3; border-right: 1px solid #162730; font-family: Tahoma; font-size: 10pt; color: #FFFFFF; } #navigation td a{ color: #FFFFFF; text-decoration: none; } #navigation td a:hover{ display: block; height: 49px; text-decoration: none; background: url('images/navigation_over.gif'); width: 68px; } </style> </head> <body> <div id="container"> <div id="header"> <img src="images/header.gif" width="790" alt="header"> </div> <div id="navigation"> <table align="left" width="340" height="49" cellpadding="0" cellspacing="0" border="0"> <tr valign="middle"> <td align="center" height="49" width="68"><a href="#">Home</a></td> <td align="center" width="68" height="49"><A href="#">Upload</A></td> <td align="center" width="68" height="49"><a href="#">Register</a></td> <td align="center" width="68" height="49"><a href="#">Members</a></td> <td align="center" width="68" height="49"><a href="#">Forums</a></td> </tr> </table> </div> </div> </body> </html> |
Now the problem is that when you hover over the link the background changes perfectly but the text ends up being at the top of the image and not valigned in the middle height. I have tried padding-top but that just makes everything worse. So any ideas?
Thanks for your help.
