html - Force some margin-top to one of 2 inline-block elements -


i have following code image text on right, on same line. text kind of vertically centered image :

| | img   mytext here | | 

here code

img, .info {    display: inline-block;  }
<img src="http://placehold.it/100x150">  <span class="info">    <span>foo</span>    <span>blah</span>  </span>

i tried apply margin info class moves img well. how can ?

thanks

as mentioned use vertical-align center items vertically. also, have make them inline-blocks add padding:

img, .info {    display: inline-block;    vertical-align:middle;  }    .info {      padding-left:32px;  }
<img src="http://placehold.it/100x150">  <span class="info">    <span>foo</span>    <span>blah</span>  </span>


Comments

Popular posts from this blog

How to check data type in C++? -

javascript - Is getTimezoneOffset() stable during daylight saving transition? -

sql server - SQL Query returns one result, does not return 0 or NULL result -