Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
Thread: Vertically align image within li
05-07-2007, 03:27 PM #1
- Join Date
- May 2007
- Thanked 0 Times in 0 Posts
Vertically align image within li
How can I vertically align an image within an element (a list item, in this case)? Iíve seen several explanations describing the many possible ways of doing this, and Iím wondering which is the simplest way, in your opinion, to accomplish this? There seems to be so much complexity to what might be considered a fairly straightforward operation, so Iím hoping you could suggest the simplest way of doing this (i.e. what do you do?).
The height of the li is known at development time, but the height of the image varies per image.
I tried setting the images to be absolutely positioned so that I could position them relative to the containing li, but that removed all images from the normal flow which is different from what Iíd like to do.
I also tried experimenting with setting the containing li and image to be an inline and block element so that vertical-align might work, but that didnít seem to work.
Any advice as to how I can make this work? Thanks.
05-08-2007, 07:31 PM #2
- Join Date
- Dec 2006
- Copenhagen, Denmark
- Thanked 5 Times in 5 Posts
Do you have some example code showing what you have tried? Possibly a link.