I have created simple html page with my custom css. but while printing mode (ctrl+p), preview do not show css and get content with only html elements.
I have used media="all" but could not work.What should i do?
I have created simple html page with my custom css. but while printing mode (ctrl+p), preview do not show css and get content with only html elements.
I have used media="all" but could not work.What should i do?
When you say custom CSS, I'm going to assume that you want the print view styling to be different from the screen view styling. To do this, you don't need to specify any type of
mediain yourlinktag. Instead, you could just add a print media query to your CSS by doing@media print { myStyles }. You only need to specify themediain alinktag if you have multiple different stylesheets that should be applied under different circumstances.When you run the following snippet, the
ptag text will change from black font color to red when you enter print view.If you don't want the print view CSS to be different from the screen view CSS, you don't have to do anything special. CSS defaults media queries to apply to everything unless you explicitly specify otherwise.