print media query css

CSS
@media print { 
 /* All your print styles go here */
 #header, #footer, #nav { display: none !important; } 
}
Source

Also in CSS: