26 May 2010

CSS for printing


I'm feeling excited knowing that we can have different css styles for normal web-view and for printing. Say, in your website there is an image which you don't want to be available for printing. You can do so simply adding some css style (display:none) for printing (media="print"). Here is the example

<html>
<head>
<style type="text/css" media="print">
.noPrint{
display: none;
}
</style>
</head>

<body>
Here is the image: <img class="noPrint" src="myPicture.jpg" />
</body>
</html>



Inline css is like below

@media print {
.noPrint{
display:none;
}
}

0 Comments:

 

© 2007 t!ps n tr!cks: CSS for printing



Template unik dari rohman


---[[ Skip to top ]]---