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?
Images have display: inline
by default.
You might want to put the image inside the paragraph.
<p><img /></p>
./
mean in the same directory and ../
mean up one directory?
Feb 12, 2014 at 18:47
<h1>
tag and one can put <img>
inside it as well to be displayed as inline
.
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>
<div style='display:inline;'>
. There's <span>
that has this exact meaning
This should display the image inline:
.content-dir-item img.mail {
display: inline-block;
*display: inline; /* for older IE */
*zoom: 1; /* for older IE */
}