PDA

View Full Version : center vertically in listbox using css



zodehala
Apr 10th, 2010, 10:01 PM
how can i center text vertically in listbox using css

http://divran.com/script/upload/images/03kibhs85qf3150dziy.gif

Excavator
Apr 10th, 2010, 10:10 PM
Hello zodehala,
Usually line-height will vertically center text for you, as long as it's only one line.
Give that a try and post back with some code if it doesn't work.

zodehala
Apr 11th, 2010, 11:08 AM
this is listbox css



.listbox
{

border:#E9E9E9 solid 1px;
background-color:#FFFFDD;
line-height:20px;
width:200px;
height:30px;
font-family:verdana,Arial, Helvetica, sans-serif;
font-size:12px;
font-weight:bold;
}


but no any changes;

abduraooft
Apr 11th, 2010, 05:27 PM
Try
.listbox{
padding:10px 2px;
border:#E9E9E9 solid 1px;
background-color:#FFFFDD;
width:200px;
font-family:verdana,Arial, Helvetica, sans-serif;
font-size:12px;
font-weight:bold;
}

Excavator
Apr 11th, 2010, 05:55 PM
Yup, my mistake... line-height doesn't have much affect there.

zodehala
Apr 12th, 2010, 09:54 PM
.............sorry