View Full Version : aligning text vertically to center of list item

08-04-2010, 09:15 PM
I have a list with a background as well as with a custom list background image. The problem is the the height of the image is larger then the normal bullet.

So when the text appears next to it it is at the bottom of the image when I want it to appear in teh center of it.

I cant seem to achieve this with margin, padding or vertical align.. what am i missing?

08-05-2010, 12:08 AM
li {
/* these 2 properties are needed */

/* for the example */

the above centers text within any element (li in this case) vertically.

it's also likely that any "line-height:" declarations are messing with the padding/margin values you are trying. See if my provided code does what you require

08-06-2010, 12:21 PM
set the proper line height for list item and padding top or padding bottom option to align text vertically to the center, you can also set vertical align to middle if the line height is fixed...