Joshua L
Joshua L

Reputation: 65

Vertical-align is not working in safari and chrome

<div class="commentator grid_3">
    <img src="http://img.gawkerassets.com/img/183mxcnx46v2cjpg/avt-large.jpg" alt="commentator">
    <span class="commentator-name"><a href="#">Joshua</a></span>
</div>

So I set commentator-name vertical-align to Top.It works in firefox but not in chrome and safari. Can someone help me out??I dont want to use position absolute when I have a perfect choice...

Upvotes: 4

Views: 25484

Answers (2)

user3231455
user3231455

Reputation: 1

Vertical line image with in div works on Chrome and Safari. The code is:

<div class="image-wrap">
    <img src="xyz.png"/>
</div>

and

.image-wrap {
    display:table-cell;
    width:400px;
    vertical-align:middle;
}

Upvotes: 0

Airen
Airen

Reputation: 2169

please add the display:inline-block to span tag.lik this:

.commentator-name{
  display:inline-block;
  vertical-align: top;
}

please view the demo.

Upvotes: 16

Related Questions