Computer >> Computer tutorials >  >> Programming >> CSS

Set different font families for screen and print with CSS


The following example specifies different font families for screen and print. 

The next CSS uses the same font size for both screens as well as a printer.

Example

<style>
   <!--
      @media screen {
         p.bodyText {font-family:verdana, arial, sans-serif;}
      }
      @media print {
         p.bodyText {font-family:georgia, times, serif;}
      }
      @media screen, print {
         p.bodyText {font-size:10pt}
      }
   -->
</style>