As the images in the block ask the same magnitude, and what would they cut off a part of the block?

-Images are different sizes
-Image must be at the center of the block
-Images should keep their aspect ratio to avoid stretching
-the unit has a fixed height and width (example:
height: 380px;
width: 320px;)

It's all for the slider out. with pure css!
It is desirable to be limited to css, if anyone got such a script, please share
Thank you!
August 19th 19 at 22:42
3 answers
August 19th 19 at 22:44
Solution
Thank You Clearly!) and will it now block to specify the border radius? ) even did not work - Anastacio commented on August 19th 19 at 22:47
: https://jsfiddle.net/soledar10/oom6gcvp/2/ - Amya.Konopelski25 commented on August 19th 19 at 22:50
: this is something I have not - Anastacio commented on August 19th 19 at 22:53
August 19th 19 at 22:46
Solution
It is desirable to be limited to css, if anyone got such a script, please share

Use the property object-fit image - codepen.
browser support - caniuse.com/#search=object-fit
polyfill - https://github.com/anselmh/object-fit - Anastacio commented on August 19th 19 at 22:49
and with the support of this option, please?) - Amya.Konopelski25 commented on August 19th 19 at 22:52
object-fit-images supports IE9+, other browsers more or less support this property out of the box - Anastacio commented on August 19th 19 at 22:55
August 19th 19 at 22:48

Find more questions by tags CSSJavaScriptPHP