6: Re: CSS Templates (response to 5)
Posted by Voice Admin on

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

7: Re: CSS Templates (response to 6)
Posted by Deleted User on

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

9: Re: CSS Templates (response to 7)
Posted by Voice Admin on

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:

  1. put your screen styles into a @media screen { } block following your @media print { } block
  2. 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

11: Re: CSS Templates (response to 9)
Posted by Deleted User on

Thanks - that seesm to have done the trick

Phil

12: Re: CSS Templates (response to 11)
Posted by Deleted User on

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 

13: Re: CSS Templates (response to 12)
Posted by Deleted User on

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