Im working on a website where i have to crop images on the left and right side, and center them. I found a solution for this, with this code: http://codepen.io/anon/pen/dXMrWj
<div class='container'>
<img src='https://source.unsplash.com/category/nature/800x1000/daily'>
</div>
-
body {
margin: 0; padding: 0;
}
.container {
width: 40%;
height: 100vh;
overflow: hidden;
display: flex;
align-items: center;
justify-content: center;
}
img {
height: 100%;
}
Only it doesn't work in Safari, is presume because the "VH" unit maybe. Does anyone know how to fix this?