I successfully centered my divs and images both horizontally and vertically using CSS:
.center {
height: 100%
}
.center-center {
position: absolute;
top: 50%;
left: 50%;
width: 100%;
transform: translate(-50%, -50%);
text-align: center;
margin: auto;
overflow:hidden;
}
.overlay {
position: relative;
max-width: 100%;
z-index: 9999999
}
.image{
position: absolute
}
<div class="center">
<div class ="center-center">
<img class="image" src="http://kb4images.com/images/picture/37509081-picture.jpg" />
<img class="overlay" src="http://makephotogreetings.com/upload/1456330147Happy%20Birthday%20Frame%20With%20Cup%20Cake%20and%20Your%20Photo.png"></img>
</div>
</div>
However, I am facing an issue with the overflow property in the "center-center" class. It hides some parts but one side remains visible. I attempted to set a specific height for the frame image, but it interferes with the positioning. Is there a solution to this problem?
I have made updates to the snippet and code for clarity.