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

java - Run spring boot application error: Cannot instantiate interface org.springframework.context.ApplicationListener -

reactjs - React router and this.props.children - how to pass state to this.props.children -

Excel VBA "Microsoft Windows Common Controls 6.0 (SP6)" Location Changes -