Velvet Star Monitor

Standout celebrity highlights with iconic style.

general

How to put img inline with text

Writer Andrew Mclaughlin

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?

3 Answers

Images have display: inline by default.
You might want to put the image inside the paragraph.
<p><img /></p>

2

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>
1

This should display the image inline:

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

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy