Guide to HTML
Creating Buttons

Link A Button

You can link a button to either a valid URL, file, either remote or local, or to an action, like posting e-mail.

Syntax:

<input type="submit" value="text" width="width">

Let's create a button that will trigger the e-mail feature of your browser.

Example:

Result:

Source:

<form type=link action="mailto:someone@somewhere.com">
  <input type="submit" value="Click here to send me e-mail">
</form>

You can also link a button to a valid URL. Let's create a button that will take you to the YAHOO search engine.

Result:

Source:

<form type=link action="http://www.yahoo.com">
  <input type="submit" value="Take me to YAHOO" width="350">
</form>

With the width modifier it is possible to create buttons with equal lengths.

Note:

The following button is linked to a file in one of my subdirectories on my provider's system. The file TEST.TXT is a dummy message with just one line of text. What happens depends on how your system is set up for handling ASCII text files. It will be shown on your screen or it will be stored on your disk. Let's take a look.

Result:

Source:

<form type=link action="test.txt">
  <input type="submit" value="Download TEST.TXT" width="350">
</form>

Now we've got the hang of it, we can also create a button that's linked to my home page.

Result:

Source:

<form type=link action="index.html">
  <input type="submit" value="Go to my index">
</form>

Instead of using the standard buttons you can also use an image.

Result:

Source:

<form type=link action="mailto:someone@somewhere.com">
  <input type="image" src="button.gif" border=0>
</form>

The only limit in creating buttons is your own imagination.



Paragraph separator