-1

I am not sure how to describe it - I want to make comments looking like facebook ones: enter image description here

But I am not sure how to align text like this - any suggestions?

Jakub Kopyś
  • 640
  • 7
  • 18

3 Answers3

2

You can use vertical-align: top to make the text aligned at the top with the image.

jsFiddle

HTML:

<img src="image.png">
<div class="text">Whatever text you want here.</div>

CSS:

.text {
  display: inline-block;
  vertical-align: top;
  width: 300px;
}
1

Vertically align text next to an image? This is how you align text next to an image

<div>
<img style="vertical-align:middle" src="<imageUrl>">
<span style="">Your text</span>
</div>
Community
  • 1
  • 1
Alastair
  • 545
  • 1
  • 8
  • 19
1

You can do it like this:

div{width: 200px;}
img{vertical-align: top;}
img, div{display: inline-block}

See fiddle https://jsfiddle.net/cvnrwo13/2/

Adam Buchanan Smith
  • 9,313
  • 5
  • 17
  • 37