HTML input type image Tutorial

In this section, we will learn what the <input type = “image”> element is and how to use it.

What is input type image in HTML?

We use HTML <input type = “image”> element in a document to create a submit button for a form but in shape of an image.

We set the image of this button using the `src` attribute.

Also, there’s a chance that the target image might have a width and height different from what is needed in a document. So in order to fix this problem and set the correct size, we can use the width and height attributes in an input element of type “image”.

HTML input type image Syntax:

<input type = “image”>

Example: using <input type=”image”> in HTML

See the Pen using <input type="image"> in HTML by Omid Dehghan (@odehghan) on CodePen.

Facebook
Twitter
Pinterest
LinkedIn

Top Technologies