Skip to content Skip to sidebar Skip to footer

Text Align Vertical Within Li

  • Catalogue
  • Manu

Solution 1:

li img { vertical-align: middle; }

Solution 2:

Demo jsBin

  ul li{
    list-style:none;
    display:inline-block;
    height:40px;
    line-height:40px;
  }
  li img{
    float:left;
    margin:5px;
  }

You need to set a height and same line-height for your li element;
for the containing images - set float : left


Solution 3:

Set the same height and line-height. This will do the trick.


Solution 4:

To align text and image, you can use margin-bottom:-5px on image element, the number depends on the size of your image.


Post a Comment for "Text Align Vertical Within Li"