+ 3
Can we write text on image using HTML? If yes, how ?
7 Answers
+ 3
Use z-index to push your image to background. Add text and give margins to text to set it on the image.
+ 1
you can use position property like below:
HTML:
<div class="image">
<img src="image.png" alt="" />
<h2>Text over the image</h2>
</div>
CSS:
.image {
position: relative;
width: 100%; /* for IE 6 */
}
h2 {
position: absolute;
top: 200px;
left: 0;
width: 100%;
}
0
You can create a container with position relative with the image in it, then for the text a new div inside the containter with with position absolute.
https://www.w3schools.com/howto/howto_css_image_text.asp
- 2
you can use an canvas.
draw the image on the canvas then draw text ontop.