#image-container{
position: relative;
display: block;
}
#image-container img{
width: 100%;
height: auto;
display: block;
}
#short-text{
position: absolute;
font-size: 2vw;
color: black;
}
<div id="image-container">
<img src="./path/to/image.png" alt="Some image">
<span id="short-text">
Short text
</span>
</div>
Why does the text appear right under the image instead of over it ?
I tried changing position and display of ‘#image-container’, ‘#image-container img’ and ‘#short-text’.
I expected one of those combination to let the short text to appear over the image and the subsequent content to appear under the image but I can’t have both
New contributor
Max Balbastre is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.