Sometimes, we want to embed an image in a button element with HTML.
In this article, we’ll look at how to embed an image in a button element with HTML.
How to embed an image in a button element with HTML?
To embed an image in a button element with HTML, we add an input with type image.
For instance, we write
<input type="image" src="http://example.com/path/to/image.png" />
to add an input with type attribute set to image
to add an image input.
We set the src attribute to the URL of the image to show.
Conclusion
To embed an image in a button element with HTML, we add an input with type image.