Align text with an image

Possible Duplicate:
How do I vertically align text next to an image with CSS?

I am having trouble on aligning my texts and an image.

the texts and image are like

texts  ---------
      | image   |
       _________ 

I want the texts to be middle of the div instead of align to top.

I have:

<div id='test'> tests <img src='/images/logo.png'/> </div>

I have used the following css but still no luck

#test{
    margin-left: 10px;
    vertical-align: middle;
}

How do I align my text to the middle with image. Thanks so much!


vertical-align:middle应该在图像上,而不是容器上。

链接地址: http://www.djcxy.com/p/41522.html

上一篇: 如何垂直居中文字旁边的文字?

下一篇: 将文字与图像对齐