Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Printer-friendly pages
#4
yojoe Wrote:Things you have to do, to print a page containing only content you want (only htnl&css, no php at all)
1. create a .css, who shows only things you'd like to print from your site (you will have to hide some content inside it, because they may inherit styles from base css; use display: none style)
2. add this css for printing purposes
Code:
<link rel="stylesheet" type="text/css" href="print.css" media="print" />
(watch the paths)
3. add printing button (you may as well stylize it using css)
Code:
<a href="#" onclick="window.print(); return false;" title="Print page">Print</a>
(This is a text link, you can place an img instead)

good luck Wink
Thanks a lot. I found another way to do the job but it is not as simple as yours.
Reply


Messages In This Thread
Printer-friendly pages - by kweber - 2010-07-30, 01:21:38
Printer-friendly pages - by Zegnåt - 2010-07-30, 01:26:14
Printer-friendly pages - by yojoe - 2010-07-30, 22:24:32
Printer-friendly pages - by kweber - 2010-07-31, 00:44:54
Printer-friendly pages - by JWH_Matthew - 2010-07-31, 11:30:37
Printer-friendly pages - by yojoe - 2010-07-31, 21:12:24



Users browsing this thread: 1 Guest(s)