Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Add link to button HTML

Tags:

html

css

I'm trying to add link to my buttons.

My current HTML codes are below

<td>
  <button style="background: url('images/button1.png') no-repeat; background-size:155px; left: 200px; width: 155px; height: 50px; border: 0;">Get Support</button>

  <td>
    <button style="background: url('images/button2.png') no-repeat; background-size:155px; left: 200px; width: 155px; height: 50px; border: 0;">Shop Bike</button>
  </td>
  <td>
    <button style="background: url('images/button2.png') no-repeat; background-size:155px; left: 200px; width: 155px; height: 50px; border: 200px;">Button Three</button>
  </td>

How can I add link to other pages for each of those buttons for example... If I click on: Get support button, it will redirect me to the support page which I already created.

like image 985
Pé Bin Avatar asked Jan 18 '26 14:01

Pé Bin


2 Answers

<a> is the HTML element used for creating links, not <button>, so use an <a> element with an href attribute instead of a <button>.

You can then style it to look at much like a button as you like (although I note that most of the CSS you are applying to your <button> elements is geared at making it look unlike a button. About the only thing you are likely to need to do to it is display: inline-block; text-decoration: none; color: black).

like image 95
Quentin Avatar answered Jan 21 '26 02:01

Quentin


You can go with this method to create a link-able button if you like.

<form method="get" action="test.html">
    <input type="submit" value="Clickable Button">
</form>

This is not styled though

like image 45
Katler Avatar answered Jan 21 '26 04:01

Katler



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!