Print Media Query Not Working

resolved

Don’t worry!! If all the CSS is messed and background color is replace with white spaces and not getting logo on print preview page.
Just follow the rules mentioned here, it will work automatically.

Just in case if you are using :

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

 

Than replace this with media=screen, print so that it will apply rules to your website as well as printing..

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

 

You can also use print specific stylesheet like this :

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

 

You can also use print specific @media queries under Existing CSS like this :

@media print {
/* Whatever */
}

Note: In Chrome Browser: To enable printing in chrome use this CSS property

-webkit-print-color-adjust:exact;

 

Leave a Comment

Your email address will not be published.