2 Ways to create HTML button as href links

The buttons of HTML are generally used to submit data to the web server, for navigation from one record to other etc. in the web pages. You can also make the buttons working as hyperlinks in your web pages. This tutorial explains how it can be done.

The way is quite simple; by placing the button code in place of anchor text the button can be used as HTML button link. There is another way to create buttons as links which is shown in the second example of this tutorial.

In the following example, we have created a link tag. The href attribute points to this website.  In order to use the button as a link, we used the button tag in place of anchor text. See the example by clicking the link below:

Anchor tag inside the button tag example

The other method to create a button link is by using the anchor tag inside the button element. In that case, you will start a button tag and rather than writing the text or caption for the button, use the anchor tag inside it, as shown in the example below.

You can also apply the style to the button or <a> tag to make it look beautiful to create the button links.

Also see HTML Table | HTML tutorial

Was this article helpful?

Related Articles


  1. Carlos

    Very useful your article, thank you very much.
    Note: The first method does not work within a form, only outside. The second is useful in and out of a form, it is ideal.

Leave A Comment?