I create some print-specific styles using the following:
@media print { /* Styles */ }
Since we use SASS, all styles are compiled into a single styles.css at runtime, which is declared in the <head> document as follows:
<link rel='stylesheet' href='/assets/css/styles.css'>
Now when I print with chrome (Ctrl + P), it completely ignores my print styles, but Firefox (30.0) is fine. IE (11) is terrible, but that is because we have many show / hide panels that IE doesn't seem to like /
It is impossible for life to understand what is happening. If I emulate print media in Chrome, then it loads the styles in the order when I actually try to print that it does not work. I tried a lot of things, adding media= attributes, double quotes, changing the order of href , etc. All to no avail !!
Note that we no longer use type , as I thought you no longer needed to use this. I tried adding this anyway, but it still doesn't work!
I even tried this: http://lawrencenaman.com/optimisation/print-media-queries-not-working/ , but it still doesn't work. It drives me crazy, any ideas?
UPDATE: So, I noticed that when I pressed Ctrl + P to print the page, the preview I see seems to use some styles from the print stylesheet, but it seems to display everything using a mobile multimedia request? I think there may be some conflict with a breakpoint, will be updated when I get a chance.
UPDATE2: I see that the print stylesheet is loading from below, so theoretically should I write all the other media queries (at least the ones I'm trying to rewrite)?
html css google-chrome printing media-queries
zik
source share