Click to See Complete Forum and Search --> : align middle


chris9902
09-18-2003, 07:56 PM
i have a menu and i want the text to be in the absolut middle of it but now it is always at the top.

how would align it to the middle.

CSS code.


#menu {
position: absolute;
top: 135px;
width: 150px;
}
#menu a {
display: block;
color: #677b92;
background-color: transparent;
font-family: Verdana, Arial, Helvetica, sans-serif;
height: 15px;
border-bottom: 1px solid #c0c0c0;
padding-left: 0px;
text-decoration: none;
}
#menu a:hover {
color: #cc3333;
background-color: #f0f0f0;
}


i did try and add

vertical-align:middle

to #menu a but it did not work

=============

the HTML is


<div id="menu">
<a href="http://www.infinitypages.com">Infinity Web Design</a>
<a href="http://www.webdevfaqs.com">Web Dev FAQs</a>
<a href="http://www.infinitypages.com/research">Research Pages</a>
<a href="http://www.w3c.org">W3C</a>
</div>


can anyone help:rolleyes:

pyro
09-18-2003, 08:10 PM
Try playing around with the padding, perhaps by adding a padding-top to the #menu a style definitions.

chris9902
09-18-2003, 08:17 PM
k

pyro
09-19-2003, 09:19 AM
Didn't think of this earlier, but what you can do is just set the line-height to the same number as the height, and it should center your text vertically.

chris9902
09-19-2003, 09:25 AM
perfect :)