I have an image, centered both, horizontally and vertically
#logo01{
position:absolute;
top:50%;
left:50%;
margin-top:-146px; // half of hei
Below is my suggestion. It works for any and the css code is: just find and test a live demo here:
https://jsfiddle.net/veuodbk7/2/ and ...
.responsive{
max-width:100%;
max-height:100%;
}
.center{
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
.parent{
position: relative;
}