Sunday 8 July 2012

CSS document for printing


CSS document for printing




Lots of web pages have a link to a print-friendly version. What many of them don't realise is that there's no need because you can set up a second CSS document to be called up when a user prints the page.


So, your page header should contains links to two CSS documents, one for the screen, and one for printing:


<link type="text/css" rel="stylesheet" href="stylesheet.css" media="screen" />
<link type="text/css" rel="stylesheet" href="printstyle.css" media="print" />



The first line of code calls up the CSS for the screen (notice the inclusion of media="screen") and the second line calls up the CSS for the printable version (using media="print").


So, what commands should you put in this second CSS document? To work it out, open a blank document and save it as printstyle.css. Next, point the screen CSS command to this document so that the command reads: 


<link type="text/css" rel="stylesheet" href="printstyle.css" media="screen" />.


Now just keep entering CSS commands until the display on the screen matches how you want the printed version to look. 


You'll certainly want to make use of the display: none command for navigation, decorative images and non-essential items. For more advice on this, read Print Different, which also mentions the other media for which you can specify CSS files.





BUDDY CHECK OUT THESE ALSO : ALL LEARNING THING , HTML , CSS , WEB FORMS ,DREAM WEAVERDTD , JAVAJAVA SCRIPT , SQL , MY SQL  , PL-SQL , PHOTOSHOP , C + + , C  , WEB PAGES , MAYAPDF FILES , EVERYTHING AVAILABLE , AJAX  , HYBERNATE , WSDL  , WAP , RUBY ON RAILS , SCALA , HTTP , HTML 5 , PROTOTYPE , Wi-MAX , FLASH , WML , RUBY , PERL ,UNIX , DLL , RSS , RADIUS , UNIX SOCKET , PYTHON , JSP , SOAP , MVC , DOT NET , PHP , ADO , ASP , J QUERY , TCP/IP , VISUAL BASIC , UML , VISUAL STUDIO , GPRS....


No comments:

Post a Comment