Thanks for that - syle.css seems to be read now, I can change stuff (colours, font sizes etc)
But I put
/*change styles when printing*/ @media print { h1 {font-size: 16px;} }
into the style sheet. But when I print preview the H1 font is as large as on screen (26pt)
Phil
Being relatively new CSS it's only supported in modernish browsers, this page seems to say which ones:
http://www.javascriptkit.com/dhtmltutors/cssmediaqueries.shtml
Unfortunately there is (currently) no way to specify your own print CSS file which can be used with older browsers.
Thanks
Voice Admin
I tried with several browsers and having this in the .CSS file
/*change styles when printing*/ @media print { body {font-size: 12px;} h1 {font-size: 115%;} h2 {font-size: 110%;} h3 {font-size: 105%;} p {font-size: 10px;} }
But no change when I Print Preview
I know the .CSS is being read as other style changes are implemented.
Is my syntax wrong or can the print output not be manipulated (which would be a pity)
Phil
I think it is probably being read correctly by the browser, but the rules following your print section are overriding the styles.
Unless you specifically limit your other rules to screen only, then later rules will always override earler rules.
So either there are (at least) two approaches:
- put your screen styles into a @media screen { } block following your @media print { } block
- define your global styles at the top of the file and put your @media print { } section at the end of the file to tweak those rules by overriding the bits you want to change.
For maximum compatibility the first option is probably best, with your print styles defined first. That way if you use an old browser which doesn't understand print/screen rules then the later rules will override the earlier ones and they won't end up with looking at the print styles all the time.
Thanks
Voice Admin
This one seems to have resurrected itself!
I have a single style sheet with @media all [ lots of styles here } and @media print { a coupe of styles here} at the bottom. So general styles should be ober-ridden by the print styles at Print Preview.
The print style is not being read at all e.g. main style is Verdana but print shows as Times (the default). If I put the print styles in a specific page it works as expected.
Any idea what I am doing wrong?
Phil
Thanks
This may be a browser problem. I am using IE10
If I use Chrome the print styles are read correctly - but the screen font type is wrong!
I will investigate firther
Phil