User Tools

Site Tools



This shows you the differences between two versions of the page.

Link to this comparison view

java:howtomakealinklooklikeabutton [2014/12/24 10:42] (current)
Line 1: Line 1:
 +====== 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: 
 +<code html>
 +  <a href="​http://​">​Please click here</​a>​
 +The corresponding button that does __exactly the same behaviour__ is this: 
 +<code html>
 +  <form method="​GET"​ action="​http://​">​
 +  <input type="​submit"​ name="​Please click here">​
 +  </​form>​
 +</​code> ​
 +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: 2014/12/24 10:42 (external edit)