Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

vertical align text in css for link

Status
Not open for further replies.

safra

Technical User
Jan 24, 2001
319
NL
Hi,

Can't figure out how to align text vertically in the middle in a link, example:

Code:
<style>
A.menu:link{background:#D5E3F2;width:145px;height:25px;vertical-align:middle}
A.menu:active{background:#D5E3F2;width:145px;height:25px;vertical-align:middle}
A.menu:visited{background:#D5E3F2;width:145px;height:25px;vertical-align:middle}
A.menu:hover{background:#FFFFFF;width:145px;height:25px;vertical-align:middle}

</style>

<a href=&quot;link.htm&quot; class=&quot;menu&quot;> test link</a>

vertical-align positions the complete link box. The text appears at the top of the coloured background. How can I get the text in the middle of the background?

Thanks,
 
this seems to work:

<td><a href=&quot;link.htm&quot; class=&quot;menu&quot;><span style=&quot;vertical-align:sub&quot;>dddddd</span></a></td>

But is there a solution without the extra span tags?

I have one other question: the width and height property seems to be ignored in at least NS7. Anyone knows why and how to solve it?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top