Monday, February 8, 2010

Print only selected div content / css print selected only

If you need to print only selected content in div and not include button print, this is simple solution help you to solve it.

<html>
<head>
<style type="text/css" media="print">
@media print
{
#non-printable { display: none; }
#printable {
display: block;
width: 100%;
height: 100%;
}
}
</style>
</head>
<body>
<div id="printable" >
Your content to print
</div>
<input type="button" id="non-printable" class=normaltext onclick="JavaScript:window.print();" value="print" />
</body>
</html>


No comments: