align middle

liunx

Guest
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.webdeveloper.com/forum/archive/index.php/"http://www.infinitypages.com">Infinity Web Design</a>
<a href=http://www.webdeveloper.com/forum/archive/index.php/"http://www.webdevfaqs.com">Web Dev FAQs</a>
<a href=http://www.webdeveloper.com/forum/archive/index.php/"http://www.infinitypages.com/research">Research Pages</a>
<a href=http://www.webdeveloper.com/forum/archive/index.php/"http://www.w3c.org">W3C</a>
</div>


can anyone help:rolleyes:Try playing around with the padding, perhaps by adding a padding-top to the #menu a style definitions.kDidn'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.perfect :)
 
Back
Top