I'm trying to vertically center an image using vertical-align: middle; but I can't seem to get vertical-align to have any effect at all. I've set the line-height and height, but nothing has an effect.
SASS:
.lot-images {
position: relative;
float: left;
min-height: 300px;
*height: expression(this.scrollHeight < 300 ? "300px" : "auto");
padding-right: 65px;
.viewer-wrapper {
height: 415px;
width: 450px;
line-height: 415px;
position: relative;
.main {
position: relative;
display: block;
text-align: center;
height: 415px;
line-height: 415px;
width: 100%;
max-width: 450px;
max-height: 415px;
font-size: 0;
cursor: pointer;
&.small {
img {
display: inline-block;
max-height: 100%;
max-width: 100%;
height: auto;
width: auto;
vertical-align: middle;
}
}
}
}
HAML:
.lot-images
%div.viewer-wrapper
.facebook
%a.pinterest{ :href => '#', :target => '_pinterest' }
.main.small
%img
%div.gallery-pager.prev.hide
%i
%div.gallery-pager.next.hide
%i
.thumbnails
This whole container is inside a modal.
Let me know if you need more info. Thanks!