User Tools

Site Tools


How to make a link look like a button

From time, appears the need of making a link to look like a button. If you search through internet you will see lots of solutions, however, it is surprising that nobody have came across this solution. If you have a link:

  <a href="">Please click here</a>

The corresponding button that does exactly the same behaviour is this:

  <form method="GET" action="">
  <input type="submit" name="Please click here">

This solution has the advantage that every style you will apply to buttons in general will affect to this (because is a fucking real button, not an styled one). The “GET” method means exactly this: make a link with the values of the parameters and navigate through it. So, putting zero parameters make the result equivalent to click on a link.

java/howtomakealinklooklikeabutton.txt · Last modified: 2022/12/02 22:02 by