Click to See Complete Forum and Search --> : CSS Set position to middle


valentin_cm
06-29-2005, 07:07 PM
Hi,

I have a menu with CSS rollover and I've been trying to set the text to stay in the middle of the button but it seems I'm unable to do that. You can check the code here: http://www.3afaceri.ro/mrpbr2/index3_css3.htm .

For the sake of wasy access, here is the CSS code:


ul.rollside {list-style-type: none;
color: #000;
background-color: #363491;
margin: 0;
padding: 0;
border-color: #ffffff;
border-style: solid;
border-width: 0px 0px 0 0px;
width: 100%;
height: 45px;
voice-family: "\"}\"";
voice-family: inherit;
padding: 0 0em;
width: 100%}
html>body ul.rollside {width: 100%}
ul.rollside li {font-weight: bold;
margin: 0;
padding: 0}
ul.rollside ul {list-style-type: none;
margin: 0em 0 0 0;
padding: 0;
border-bottom: 0px solid #dda;
voice-family: "\"}\"";
voice-family: inherit;
margin: 0em 0em 0 0em}
ul.rollside a {font-weight: normal;
text-decoration: none;
color: #ffffff;
background-color: transparent;
margin 0;
width: 100%;
height: 45px;
border-top: 0px solid #dda;
display: block;
voice-family: "\"}\"";
voice-family: inherit;
}
html>body ul.rollside a {width: auto}
ul.rollside a:hover {color: #ffffff;
background-color: #9A99C8}



Please advice :D .


Thanks in advance,
Valentin

toicontien
06-30-2005, 12:53 PM
Are you talking about aligning just the text? In that case add text-align: center; to the style declaration for ul.rollside a.

I'm not sure what you mean by align. Vertical or horizontal? If you want the items vetically aligned, get rid of height: 45px; in ul.rollside a and replace it with line-height: 45px;

valentin_cm
07-03-2005, 12:28 PM
Hi,

Thanks a lot for the help, I meant vertical align of the text. Solved it with line-height:45px instead of height:45px as you said. :D

Cheers,
Valentin