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
  • 16

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,757
  • 4
  • 17
  • 34
0

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

Mujtaba Hassan
  • 2,447
  • 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
  • 217,782
  • 47
  • 385
  • 346
Jeow Li Huan
  • 3,718
  • 1
  • 34
  • 52