Ever wondered how to create this type of Clickable HTML Buttons (Like the image below) inside the WordPress posts and pages?
Here is the best way to do it…
Inserting the HTML Code inside WordPress Posts and (or) Pages
To insert any kind of code into your WordPress website, you can use button (<button> </button>) tags in order to put HTML codes into it.
First, log in to your WordPress website and open the post/page that you want to create the button in. After opening the post (page), provide any title to the post (page) and then go to the text mode instead of visual mode. As shown in the image below.
Make sure that you’re in the text mode and then you can write the HTML code for inserting the button.
Clickable HTML Button Without CSS
<a href="Example.com"> <button> This is an example of HTML Button </button> </a>
You can add a simple HTML clickable button by writing the above code. Above is the example of a simple and non-decorated HTML button. You can copy the above code, then replace the Example.com with your domain name and This is an example of HTML Button with the text what you wanna show on the button.
After you insert the above button code inside your WordPress, your button will look something like the button’s image above.
Clickable HTML Button With CSS
Didn’t like the previous button without CSS?
Well, you can decorate the button by adding little CSS code into the same. Below is the example of HTML button decorated with little CSS.
<a href="Example.com"> <button style="background-color: #4caf50; border: none; color: white; padding: 10px; text-align: center; text-decoration: none; display: inline-block; font-size: 16px; cursor: pointer; margin: 4px 2px; border-radius: 5px;"> This is an example of HTML Button </button> </a>
When you will add this code inside your WordPress pages or posts your button will look like this:
You can personalize this button as per your needs by changing the values of background color, text color, border, padding, margin, text alignment, font size, border radius etc.
For any further information on this, don’t forget to leave a comment.