In Css using Position relative and absolute you can put the text on top of the image.
For Example:
.container {
position:relative;
}
.text_on_top {
postion:absolute;
top:0px;
left:10px;
}
<div class="container">
<img src="image.png" alt="image" />
<p class="text_on_top">Text for Image on the top</p>
<div>
Refer More Details for about position relative vs absolute