How to make mail to action button in html

A "Call-to-Action" (CTA) button is a crucial element in any marketing campaign, and HTML is a great way to create one. Here's a step-by-step guide on how to make a CTA button in HTML:

Basic HTML Structure

<button type="button">Click me!</button>

The above code creates a basic button element with the text "Click me!".

Customizing the Button To make the button more visually appealing and effective, you can add some CSS styles and attributes. Here's an example:

<button type="button" class="cta-button">Get Started Today!</button>

In this example, we've added a class cta-button to the button element, which we'll use to apply some CSS styles later.

CSS Styles To style the button, you can add the following CSS code:

.cta-button {
  background-color: #4CAF50; /* green color */
  color: #fff; /* white text color */
  padding: 10px 20px; /* padding for the button text */
  border: none; /* remove the default button border */
  border-radius: 5px; /* add a rounded corner effect */
  cursor: pointer; /* change the mouse cursor to a hand when hovering */
}

.cta-button:hover {
  background-color: #3e8e41; /* darker green color on hover */
}

In this example, we've defined two CSS styles:

  1. .cta-button: This style sets the background color, text color, padding, border, and border radius for the button.
  2. .cta-button:hover: This style sets the background color to a darker green color when the user hovers over the button.

Adding a Link or Action To make the button functional, you can add a link or an action to it. For example, you can add a link to a landing page or a form submission action:

<button type="button" class="cta-button" onclick="submitForm()">Get Started Today!</button>

<script>
  function submitForm() {
    // code to submit the form goes here
  }
</script>

In this example, we've added an onclick attribute to the button element, which calls the submitForm() function when the button is clicked.

Putting it all Together Here's the complete HTML and CSS code:

<style>
 .cta-button {
    background-color: #4CAF50;
    color: #fff;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
  }

 .cta-button:hover {
    background-color: #3e8e41;
  }
</style>

<button type="button" class="cta-button" onclick="submitForm()">Get Started Today!</button>

<script>
  function submitForm() {
    // code to submit the form goes here
  }
</script>

This code creates a visually appealing CTA button with a green background, white text, and a rounded corner effect. When the user clicks the button, it calls the submitForm() function, which can be used to submit a form or perform any other action.