Home >Web Front-end >CSS Tutorial >Use CSS to set different font families for screen and print

Use CSS to set different font families for screen and print

WBOY
WBOYforward
2023-08-30 12:45:02819browse

使用 CSS 为屏幕和打印设置不同的字体系列

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

The next CSS uses the same font size on screen and 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>

The above is the detailed content of Use CSS to set different font families for screen and print. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:tutorialspoint.com. If there is any infringement, please contact admin@php.cn delete