<div class="container">
<div class="box">
<img src="https://calbum.qiniu.songxingguo.com/album/0/201912081728_%E4%B8%8A%E6%B5%B7-%E9%BB%84%E6%B5%A6_7_0/tiny" alt="">
</div>
</div>
.container {
width: 20px;
height: 10px;
}
.box {
width: 100%;
height: 100%;
padding:10% 50%;
position:relative;
}
.box > img {
position:absolute;
width:100%;
height:100%;
left:0;
top:0;
right:0;
bottom:0;
}
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.