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
Release: 2023-08-30 12:45:02
forward
857 people have browsed it

使用 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>
Copy after login

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!

source:tutorialspoint.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template