Mr Riksson
Mr Riksson

Reputation: 560

image button opening another url

I'm working on a project where I want to have an image as a button, and when pressed it should open another URL.

I've managed to open another URL with just plain text by using this:

<a href="test.html">Page2</a>

I've tried these 2 ways:

This one doesn't do anything from my understanding:

<a href="index.html" src="btn.png"></a>

This one does show the image / button but does not open the next URL when pressed.

<input type="image" src="btn.png" a href="index2.html"/>

Upvotes: 2

Views: 1296

Answers (1)

mplungjan
mplungjan

Reputation: 178051

You are looking for

<a href="index.html"><img src="btn.png" alt="Index"/></a>

Have a look here:

http://htmldog.com/guides/html/beginner/conclusion/

Upvotes: 1

Related Questions