Javatpoint Logo
Javatpoint Logo

HTML Image Button

The image buttons in the HTML document can be created by using the type attribute of an <input> element. Image buttons also perform the same function as submit buttons, but the only difference between them is that you can keep the image of your choice as a button.

Syntax

Examples

Example 1: This example is used to specify the image button without using CSS.

Test it Now

Output:

HTML Image Button

Example 2: This example is used to specify the image button using CSS style. Its output is also same as the above example but the implementation is different.

In the following example, we are using the <button> tag for specifying the image button on a web page.

Test it Now

Output:

HTML Image Button

Browser Support

Elementchrome browser Chromeie browser IEfirefox browser Firefoxopera browser Operasafari browser Safari
Image ButtonYesYesYesYesYes

Attributes

Alt:

This attribute is used to specify the alternate text, which is to be displayed when the image cannot be displayed on the user?s screen.

Border:

This attribute is used to specify the image border. If you put its value as 0, then no border will be displayed.

Height:

This attribute is used to define the pixels of the height of an image.

Name:

This attribute is used to define the name of an image.

Src:

This attribute is used to specify the image path which needs to appear as a button.

Width:

This attribute is used to define the pixels of the width of an image.


Next TopicHTML Nested Table




Youtube For Videos Join Our Youtube Channel: Join Now

Help Others, Please Share

facebook twitter pinterest

Learn Latest Tutorials


Preparation


Trending Technologies


B.Tech / MCA