Skip to content

Instantly share code, notes, and snippets.

<div class="imgbox">
<div class="imgbox-inner">
<img class="image" src="./images/example1.jpg" alt="">
</div>
</div>
.imgbox .image{
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%,-50%);
max-width: 100%;
max-height: 100%;
}