I have a container with some "background" text. I want to center an image in this container and over the text. NOT the text over the image.
The effect I'm looking to reproduce is as below where the shoe is over the Desrupt(?) text.
However, I am not able to center the image in the container. I have created THIS PEN to show what I have.
How do I create a similar effect as per the demo image? Ideally, the image of the penguin should be 75% the width of its container and the "What is lorem" text should be able to be positioned in the container with e.g. margin-top at 20% (so that the text is more readable rather than be completely hidden behind the image) without affecting the position of the image.
My CSS
/* Image over text */
.image-over-text {
position: relative;
width: 100%;
height: auto;
}
.image-over-text p {
color: #000;
font-size: 4em;
margin-top: 50%;
margin-bottom: 50%;
text-align: center;
font-weight: 700;
border: 1px solid green;
}
.image-over-text img {
position: absolute;
bottom: 0;
right: 0;
width: 75%;
height: auto;
border: 1px solid red;
}