I've successfully aligned one line of text with an image (fiddle).
<div class="profile-details-wrapper">
<img class="profile-picture" src="http://placehold.it/50x50" />
<span class="profile-details">
username
</span>
</div>
However, when I try to add another line of text, it wraps under the image (fiddle).
<div class="profile-details-wrapper">
<img class="profile-picture" src="http://placehold.it/50x50" />
<span class="profile-details">
username
<br />
username
</span>
</div>
How can I have multi-line text that exceeds the height of the image next to it, but does not wrap underneath it?
Bonus question: How would I go about aligning it vertically, too?
Building on @freestock.tk's tabular example..
.profile-details-wrapper { display: table-row; }
.profile-picture {
display: table-cell;
vertical-align: top;
margin-right: 10px;
}
.profile-details { display: table-cell; vertical-align: top; }
<div class="profile-details-wrapper">
<img class="profile-picture" src="http://placehold.it/50x50">
<div class="profile-details">
text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here
</div>
</div>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With