the text must be inside of the image,which is not?
-
Hello,
this is html code:
<div class="onderhoud-page-image-container"> <img src="https://webdesignmaster.eu/wp-content/uploads/2023/09/apk-in-rotterdam-1.webp" alt="Auto onderhoud"> <div class="image-text-onderhoud-page">Auto Onderhoud</div> </div>
and this is css :
.onderhoud-page-image-container { position: relative; display: inline-block; width: 100%; margin: 0 auto; /* Center the container horizontally */ } .onderhoud-page-image-container img { max-width: 100%; width: 1560px; display: block; max-height:750px; height:100%; object-fit: cover; object-position: center; } . .image-text-onderhoud-page { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); background-color: rgba(0, 0, 0, 0.7); color: white; padding: 5px; font-size: 16px; font-weight: bold; }
I want the text to be inside of the image but it is still ouside of the image under the image on the left side ouside .
can someone tell me what I am doing wrong or can fix this code?
I had the same problem long ago but I have removed that theme on that time which I had to keep it.
thanks
The page I need help with: [log in to see the link]
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘the text must be inside of the image,which is not?’ is closed to new replies.