0

Is it possible to align this using CSS, so the text will be vertically centered next to image?

<div><img class="paragraph-icon" src="images/desc.png" /><h4>Description</h4></div>
Pablo
  • 26,392
  • 33
  • 117
  • 202

2 Answers2

4

try this:

<div style="height=IMAGE_HEIGHT; line-height:IMAGE_HEIGHT">  
    <img class="paragraph-icon" src="images/desc.png" />
    <h4 style="display: inline;">Description</h4>  
</div>`

replace IMAGE_HEIGHT with your image's height (and don't forget to add 'px;'), and that should make everything in that div centered vertically.

Maikel
  • 371
  • 1
  • 2
  • 10
0

use this

<div>
    <img class="paragraph-icon" src="images/desc.png" style="vertical-align: middle;">
    <h4 style="display: inline;">Description</h4>
</div>
Vinay B R
  • 7,635
  • 2
  • 27
  • 45