How to use CSS @media print to control printing

Source: Internet
Author: User

How to use CSS @media print to control printing?

<HTML> <HEAD> <TITLE> New Document </TITLE> </HEAD>
<BODY> <style media= "Print" >//this represents the style at the time of printing. noprint {display:none;font-size:19px; Color:blue; } </style>
<style media= "Screen" >//This means that the sample works on the display. Print {font-size:19px; color:red; } </style>
<body> <span class= "print" > Print section </span><br><br><Br> <span class= "Noprint" > does not print, but can see part </span> </BODY> </HTML>

==================================================================== @media version: CSS2 Compatibility: ie5+
Grammar:
@media Smedia {Srules}
Description
Smedia: Specifies the device name. See Appendix: Device Type srules: style sheet definition
Specifies a style sheet rule for the specified device type. See the link object's media properties (attributes).
Example:
Set the display Font size @media screen {BODY {font-size:12pt;}}
Set the font size for the printer @media print {@import "print.css" BODY {font-size:8pt;}}

=====================================================================

Media Types Device Type
Media type Device type CSS version compatibility compatibility Description Introduction All CSS2 ie4+ for all device types aural CSS2 NONE for speech and music synthesizer Braille CSS2 None for haptic device embossed CSS2 none for convex dot character (braille) printing equipment handheld CSS2 None for small or portable devices print CSS2 ie4+ for printer projection CSS2 NO NE is used for projecting images such as slide screen CSS2 ie4+ for computer monitor TTY CSS2 NONE for devices that use fixed spacing character formatting. such as telex typewriter and terminal TV CSS2 NONE for TV class equipment

How to use CSS @media print to control printing

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.