Vertical-Alignment on Image and Text in Span

PHP Web Dev 101

I have a text and image vertically aligned perfectly.

Screenshot 1

(Question/Issue) But I would like to put another line under it, like so...

Screenshot 2

I've tried putting a <br\> in the span but the text then goes directly under the image.

Here's the code for the first vertical alignment.

<img src="/" class="circular" style="vertical-align:middle;">
<span class="text">Text</span>
Praveen Singh

You can use line-height on text if you know image's height.

See this snippet:

.img {
    float: left;
}
.txt {
    float: left;
    margin: 5px 0 5px 10px;
}
.txt-line {
    line-height: 20px;
}
<div>
    <img class="img" src="http://placehold.it/50x50" />
    <div class="txt">
        <div class="txt-line">Title</div>
        <div class="txt-line">Description</div>
    </div>
</div>

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related