Will have a time you need set email always in the center of DIV tag, even it is horizontal or vertical image. So now, I shared a angularjs directive that will do it for you. In this code, It will cacth event image loaded and check image is horizontal or vertical and set a suitable margin and position.
1 2 3 4 5 6 |
app.directive 'centerImage', ()-> restrict: 'ACE', link: ($scope, element, attrs, ctrl) -> element.bind 'load', -> if (element[0].width > element[0].height) element[0].style.marginTop = (element[0].width - element[0].height)/2 + 'px' |