[html] How to put img inline with text

I have this code:

<div class = "content-dir-item">
    <p>Text input</p>
    <img src="./images/email.png" class = "mail" alt="img-mail" />
</div>

I would put img inline with text using css. How can I do this?

This question is related to html css

The answer is


Please make use of the code below to display images inline:

<img style='vertical-align:middle;' src='somefolder/icon.gif'>
<div style='vertical-align:middle; display:inline;'>
Your text here
</div>

This should display the image inline:

.content-dir-item img.mail {
    display: inline-block;
    *display: inline; /* for older IE */
    *zoom: 1; /* for older IE */
}