Rotate vertically vertically

How do I align these two icons with float: right

?

plunkr

Html

<li>
  <img src="https://graph.facebook.com/102031900129645/picture?type=square" />
  <a href=""> Johnny Smith </a>
  <span class="">
    <i class="fa fa-check"></i>
    <i class="fa fa-close"></i>
  </span>
</li>

      

CSS

li {
  width: 200px;
  list-style-type: none;
}

img {
  vertical-align: middle;
}

span {
  float: right;
  vertical-align: middle; // not working
}

      

+3


source to share


3 answers


If you want to align icons with text, for a range

.span {
    float: right;
    padding-top: 15px;
}

      



Just.

+1


source


Floating elements do not obey vertical-align

. Instead, you need display: inline-block;

: http://plnkr.co/edit/zTdoW4TBUbREzI4ADTQO?p=preview



0


source


You can do it with line-height

:

span {
  float: right;
  line-height: 50px;
}

      

http://plnkr.co/edit/bE1dEvtEp60SpiobfUje?p=preview

0


source







All Articles