This is so stupid, I bet the fix is very easy. I have a nav bar that's 770px wide by 40px high and want the links centered both vertically and horizontally in the table cell. That part is simple. What I can't get is the CSS hover to use an image and extend the full 40px height and still stay centered and vertically aligned.
My css:
My HTML
What am I missing here? I have tried turning the A into a display: block but that just fubars everything (unless I have done it incorrectly). Keep in mind those are only a few links so I can't do any width settings for the <a>'s.
TIA
NATE
Got a question? Search G O O G L E first.
My css:
Code:
#nav
{
margin: 0px;
padding: 0px;
height: 40px;
background-image: url('/images/nav_bg.gif');
background-repeat: repeat-x;
}
#nav a:active, #nav a:link, #nav a:visited
{
height: 40px;
vertical-align: middle;
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 13px;
font-weight: bold;
color: #ffffff;
text-decoration: none;
padding: 0px 12px 0px 12px;
}
#nav a:hover
{
height: 40px;
vertical-align: middle;
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 13px;
font-weight: bold;
color: #ffffff;
text-decoration: none;
padding: 0px 12px 0px 12px;
background: #ccff00;
background-image: url('/images/nav_hover.gif');
background-repeat: repeat-x;
}
My HTML
Code:
<table border="0" cellpadding="0" cellspacing="0" width="770">
<tr>
<td>
<a href="/"><img src="/images/banner.jpg" width="770" height="135" alt="" border="0"></a></td>
</tr>
<tr>
<td id="nav" align="center" valign="middle">
<a href="">Home</a>
<a href="">Design</a>
<a href="">Hosting</a>
<a href="">Domains</a>
<a href="">Contact Us</a></td>
</tr>
</table>
What am I missing here? I have tried turning the A into a display: block but that just fubars everything (unless I have done it incorrectly). Keep in mind those are only a few links so I can't do any width settings for the <a>'s.
TIA
NATE
Got a question? Search G O O G L E first.