Button is an HTML element.
A button in HTML is an interactive element that users can click or press to perform an action or submit a form.
The
We can specify the text content of the button between the opening and closing
The
Specifies the type of button. Common values include "button" (default), "submit", and "reset".
Useful when the button is part of a form and you want to send its name and value when the form is submitted.
Disables the button, preventing user interaction.
Executes JavaScript code when the button is clicked.
This CSS code defines a class called ".button" which styles an HTML element as a button.
We can then apply this class to any HTML element (typically
.button { display: inline-block; padding: 8px 16px; background-color: #333; color: white; border: none; border-radius: 10px; font-size: 14px; text-align: center; text-decoration: none; cursor: not-allowed; }
.button:hover { background-color: white; color: black; cursor: pointer; }
<button class="button">Hover on me</button>
Buttons are essential for creating interactive web pages and providing users with a way to trigger actions or navigate through the content.
They can be styled and customized to fit the design and functionality requirements of your website.