0

i have a DIV with a size x and some images in it with often a larger size. And in this case i need the image vertical centered in this DIV.

Dows anyone know, how i can realize that?

Thanks for reading that!

deelite
  • 355
  • 4
  • 17

3 Answers3

0

You can place the images inside divs and place those divs into the Your div and after words to center them

You can also make a class fo those divs and in the css part position:center;

Mpampinos Holmens
  • 1,879
  • 5
  • 18
  • 34
0

You can use vertical alignment as here http://phrogz.net/css/vertical-align/index.html

Mujtaba Hassan
  • 2,495
  • 2
  • 20
  • 29
0

If the div contains only images and no text/one liner, you can set line-height=height and use vertical-align to center the image.

<div style="height: 10px; line-height: 10px">
    <img src="" style="vertical-align: middle"/> 
</div>

PS: It is important to have a space character after the <img/> to force the image to align to the space in IE6.

thirtydot
  • 224,678
  • 48
  • 389
  • 349
Jeow Li Huan
  • 3,758
  • 1
  • 34
  • 52