How ToJavaScriptMake Web StoriesQuiz GeneratorFAQ Schema GeneratorTable Maker3schools TranslateMore Tools..
Apu
Apu 11/24/2022

How to create an HTML button that acts like a link

In this article we will explain some methods. You can use these to create a button that reacts like a link.

[1] Adding button element inside anchor element. #

Simply use the button element inside an anchor element.

<a href="https://example.com">
  <button>Click Me</button>
</a>

[2] Style the anchor element as a button. #

The anchor (<a>) element is used to create a hyperlink. So, we will style the anchor element as a button.

<a href="https://example.com">
  Click Me
</a>
<style>
  a{
    padding: 5px 10px;
    text-decoration: none;
    color:inherit;
    border-radius:5px;
    box-shadow: 0 0 5px rgba(0,0,0,0.2);
  }
</style>

In the above example, we used the CSS to make it look like a button. For example, we have added a background color, padding etc.

Share

How to create an HTML button that acts like a link

0
In this article we will explain some methods. You can use these to create a button that r…
asked
0 answers

Write an Answer

Related Posts
Write an answer
back