How to Use Images as Buttons in HTML? Last Updated : 21 May, 2025 Summarize Comments Improve Suggest changes Share Like Article Like Report Images can work like buttons to make a website more interactive and visually appealing. Over 70% of modern websites include image-based elements to enhance user experience. This article shows different ways to turn images into clickable buttons using simple HTML.1. Using the img Tag Inside the Button ElementWe can wrap the <img> tag inside a <button> element. This technique is useful for creating interactive buttons that feature custom images, while still utilizing the semantic and interactive features of the <button> element. index.html <button type="button"onclick="alert('Image Button clicked!')"> <img src="https://media.geeksforgeeks.org/wp-content/uploads/20240905154658/gfglogo.jpg" alt="Button Image" style="width: 50px; height: 50px;"> </button> OutputUsing img tag inside button element2. Using <button> Element with Background ImagesThis approach involves applying a background image to a standard <button> element. It provides the flexibility of using CSS for styling and interaction effects. The button element in HTML creates a clickable button on your web page, By default, it has text or a label, but you can customize it to include images or styles. index.html <!DOCTYPE html> <html> <head> <style> .image-button { width: 100px; height: 100px; background-image: url( 'https://media.geeksforgeeks.org/wp-content/uploads/20240905154658/gfglogo.jpg'); background-size: cover; border: none; cursor: pointer; } </style> </head> <body> <button class="image-button" onclick="alert('Button clicked!')"> </button> </body> </html> OutputUsing button element with background images3. Using <input> Element with Image TypeWe will use the <input> element with type="image". It creates an image-based submit button that can be used in forms. This approach is straightforward and adds a nice visual touch to you site. IN HTML, <input> element is used to create interactive controls in a web form. index.html <form action="/submit-url" method="post"> <input type="image" src= "https://media.geeksforgeeks.org/wp-content/uploads/20240905154658/gfglogo.jpg" alt="Submit" width="100" height="50"> </form> Output Comment More infoAdvertise with us Next Article How to Use Images as Buttons in HTML? Y yuvrajghule281 Follow Improve Article Tags : Web Technologies HTML Similar Reads Non-linear Components In electrical circuits, Non-linear Components are electronic devices that need an external power source to operate actively. Non-Linear Components are those that are changed with respect to the voltage and current. Elements that do not follow ohm's law are called Non-linear Components. Non-linear Co 11 min read JavaScript Tutorial JavaScript is a programming language used to create dynamic content for websites. It is a lightweight, cross-platform, and single-threaded programming language. It's an interpreted language that executes code line by line, providing more flexibility.JavaScript on Client Side: On the client side, Jav 11 min read Web Development Web development is the process of creating, building, and maintaining websites and web applications. It involves everything from web design to programming and database management. Web development is generally divided into three core areas: Frontend Development, Backend Development, and Full Stack De 5 min read HTML Tutorial HTML stands for HyperText Markup Language. It is the standard language used to create and structure content on the web. It tells the web browser how to display text, links, images, and other forms of multimedia on a webpage. HTML sets up the basic structure of a website, and then CSS and JavaScript 11 min read Spring Boot Tutorial Spring Boot is a Java framework that makes it easier to create and run Java applications. It simplifies the configuration and setup process, allowing developers to focus more on writing code for their applications. This Spring Boot Tutorial is a comprehensive guide that covers both basic and advance 10 min read React Interview Questions and Answers React is an efficient, flexible, and open-source JavaScript library that allows developers to create simple, fast, and scalable web applications. Jordan Walke, a software engineer who was working for Facebook, created React. Developers with a JavaScript background can easily develop web applications 15+ min read React Tutorial React is a powerful JavaScript library for building fast, scalable front-end applications. Created by Facebook, it's known for its component-based structure, single-page applications (SPAs), and virtual DOM,enabling efficient UI updates and a seamless user experience.Note: The latest stable version 7 min read JavaScript Interview Questions and Answers JavaScript is the most used programming language for developing websites, web servers, mobile applications, and many other platforms. In Both Front-end and Back-end Interviews, JavaScript was asked, and its difficulty depends upon the on your profile and company. Here, we compiled 70+ JS Interview q 15+ min read Class Diagram | Unified Modeling Language (UML) A UML class diagram is a visual tool that represents the structure of a system by showing its classes, attributes, methods, and the relationships between them. It helps everyone involved in a projectâlike developers and designersâunderstand how the system is organized and how its components interact 12 min read 3-Phase Inverter An inverter is a fundamental electrical device designed primarily for the conversion of direct current into alternating current . This versatile device , also known as a variable frequency drive , plays a vital role in a wide range of applications , including variable frequency drives and high power 13 min read Like