How to Create a Print Button on a Web Page

A print button on your web page will allow your visitors to quickly print the contents of the page. When the button is pressed, the browser's print dialog box will pop up. Then all the user has to do is choose his printer from the list, change the properties if he desires, and then click "OK" to print the web page.

Instructions

    • 1

      Open the file that contains the HTML code for your web page for editing.

    • 2

      Go to the <body> section of your HTML code. Find the exact point in your page where you want to insert your print button. Ideally, it should be at either the very top or bottom of the page. Type in <p> to allow some space between the previous line and the print button.

    • 3

      Create an input tag, as you would with a form, and use Javascript code to create your button. Type in "<input type=button onClick=window.print() value=Print>" (without the quotation marks). This tells the user's browser to bring up the "Print" dialog box. You can change "Print" under the value attribute to whatever word or phrase you want.

    • 4

      Create a javascript link to create your print button as an alternative. Type in "<a href=javascript:window.print()><img src=imagehere.jpg></a>" (no quotation marks) instead of the code in step three. The "imagehere.jpg" reference should contain your own link to an print button image on your web server. You can create this button in an image editing program, such as Adobe Photoshop.

    • 5

      Type in a <br> tag to go to the next line and write a short line underneath the print button, in parentheses, to describe why the user should press the button. For example, you can type "Click here to print this page and review it at your leisure." You can also add this line before the print button if you want.

    • 6

      Save the HTML file and upload it to your website. Click the print button to test it out.

Tips & Warnings

  • If you want to use a customized print button image and you do not have an image editing program, you can find a pre-made button on a site that offers royalty-free images (see Resources. Type the phrase "print button" into the site's search box to pull up a collection of possible buttons that you can use.

Related Searches:

References

Resources

Comments

You May Also Like

Related Ads

Featured