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