-1

I'd like to add this image in the middle of the div vertically, but it is on top. any ideas how to put this float left image in the middle of the div?

https://jsfiddle.net/2qcz5493/

.full_p{
    width:100%;
    height:80px;
    line-height:80px;
    text-align:left;
    border:1px solid #000;
}
.full_p img{
    float:left;
    width:50px;
    vertical-align:middle;
    border-radius:50px;
}
RGS
  • 4,062
  • 4
  • 31
  • 67

2 Answers2

1

OK, so in the fiddle the image does not load so I do not have an idea of image size but try this code in your fiddle and see if it helps.

.full_p{
    width:100%;
    height:80px;
    line-height:80px;
    text-align:left;
    border:1px solid #000;
}
.full_p img{
    width:50px;
    vertical-align:middle;
    border-radius:50px;

}

.full_p a{
    float:left;
    width:50%;
    vertical-align:middle;
    border-radius:50px;
   text-align: center;
}

Basically, your element is not a direct child of the div but of a element. This is what is causing the issues in my opinion and so if we style the which is a child of the div then you can get the results you are looking for.

Top-Bot
  • 782
  • 1
  • 6
  • 21
1
.full_p{
    width:100%;
    height:80px;
  background:black;
    line-height:80px;
    text-align:left;
    border:1px solid #000;
}
.full_p img{
  background:yellow;
    float:left;
    width:50px;
    vertical-align:middle;
    border-radius:50px;
}
a{
  display:table;
  margin: 0 auto;
}
Dexter
  • 754
  • 6
  • 14