EN
HTML - image input
0 points
In this article, we would like to show you how to create and use image input in HTML.
Quick solution:
xxxxxxxxxx
1
<input type="image" src="https://dirask.com/static/bucket/1632934722_loupe.svg" />
In this example, we create image input that represents submit button using loupe (magnifier) SVG image.
xxxxxxxxxx
1
2
<html>
3
<body>
4
<form>
5
<label>
6
<span>User avatar: </span>
7
<br />
8
<input type="image"
9
src="https://dirask.com/static/bucket/1632934722_loupe.svg"
10
width="50px"
11
height="50px"
12
alt="User avatar" />
13
</label>
14
</form>
15
</body>
16
</html>
Note:
The
alt
attribute is used by SEO and when the image is not loaded correctlyalt
text appears.