0

Please check the fiddle : https://jsfiddle.net/c3Lga94L/1/

Here I want to place the text in the middle of the image adjacent to it. Can someone please advise?

Here is the code:

<div>
  <div style='display:inline-block'>
  <img style='width:35px;height:35px;border:1px' src='posts/images/1.jpg' />
  </div>
  <div>this text should appear in the middle of the adjacent image
  </div>
</div>
Ajay Makwana
  • 2,330
  • 1
  • 17
  • 32
user3478137
  • 9
  • 1
  • 5
  • 3
    already asked question here: http://stackoverflow.com/questions/9209764/horizontal-centering-text-over-image-via-css – Can Guney Aksakalli Feb 20 '16 at 09:36
  • Make a div, put your text in it. Also the image too via css, like doing background:url(imagepath) and then assign this property to that div `text-align:center` – YourFriend Feb 20 '16 at 09:41
  • https://jsfiddle.net/c3Lga94L/10/ - Wasn't sure if you mean aligned vertically but alongside the image, or placed as an overlay on the image. Added both examples to the JSFiddle here :) – Crispin Twig Feb 20 '16 at 19:03

0 Answers0