How to show middle of image in div using css ?
https://jsfiddle.net/yn7hubkd/
CSS:
.out{
width: 500px;
height: 500px;
overflow: hidden;
}
HTML:
<div class="out">
<img src="https://redditupvoted.files.wordpress.com/2016/03/waffles-cat.jpg">
</div>
I get this output: https://i.sstatic.net/o59iI.png
But I want to get it like this (centered in x-direction, black square is image and red square is div class out): https://i.sstatic.net/4dT5a.png
The output result is: https://i.sstatic.net/aHgCc.png