I was looking for a solution where I have text on top of an image.
I found solutions similar to this:
<div>
<div class="centered" style="position:absolute; top:50%; left:50%; transform:translate(-50%, -50%);">
No Events found
</div>
<img src="https://www.steelmint.com/nw/public/images/events-01.svg" alt="Snow" style="width:100%;
position:relative; text-align: center; opacity:0.4;">
</div>
Now I realized due to the position
-style my text will be displaced if I for example
- Zoom in/out
- Change Window Height/Width
- Switch to Smartphone-View
How is this usually solved so my text stays over my image?
My idea was to just create an image where the text is part of the image and then bind that image to my <img>
- Tag. Is this a common way to do?
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…