2 Ways to create HTML button as href links

2 Ways to create HTML button as href links

The button as a link

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.

A button link of HTML example

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:

HTML button link example

Experience this online

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.

HTML button link

Experience this online

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