13.02.2013 Views

WEB STANDARDS CREATIVITY

WEB STANDARDS CREATIVITY

WEB STANDARDS CREATIVITY

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

206<br />

The eagle-eyed among you will notice that the controls that appear on the page to selectively print certain sections are not<br />

showing on the printout. Well, why would you need them on a printout? You can’t click them or do anything on paper, so<br />

these dynamically generated controls are switched off in the print style sheet, like so:<br />

@media print<br />

{<br />

p.printbutton<br />

{<br />

display:none;<br />

}<br />

}<br />

You could find many different uses for the technique, but essentially, it’s handy wherever there’s a large amount of content<br />

of which only a portion might sometimes need to be printed. The original posting on my personal site, where the technique<br />

was first put forward, is still up and available for comment (see http://tinyurl.com/p9tqb), including any suggestions that<br />

people have to improve the technique.<br />

Conclusion<br />

If there is one conclusion I would draw from this exercise, it’s that it’s all too easy to dismiss an idea on the basis that the<br />

browser can’t do it. With the DOM, CSS, and JavaScript, you can custom-build functions to suit wildly inventive ideas and provide<br />

solutions to long-standing browser issues that looked like they never could be fixed. Print is often overlooked on the Web,<br />

but this need not be the case. Some fine-tuning can go a long way. And it can also save a tree or two in the process, which is<br />

all good.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!