Sunday 9 October 2011

Download File Button


With this tweak I will show you how to make a simple button that will allow your visitors to download files with the use of  HTML <form> and <button> tags.


Their are other methods to make this button as well but I am doing it this way as a demonstration in using these HTML tags.  Also some other methods require JavaScript which I am trying to avoid since some users disable JavaScript on their browser.  


The syntax for creating a download file button is as followed.
<form action="Direct Link To File" method="get">
  <button>Download Now</button>
</form>


Red text is the direct link to the file you wish for your users to download.
Orange text is the title to display on the button.


The code above will render the following.

No comments:

Post a Comment