一、直接在同一个文件中:
<style type="text/css">
/*网页上显示时,背景为灰色*/
body{
background-color:#888888;
margin:0px;
height:100%;
}
/*打印时,背景为白色*/
@media print{
body{
background-color:#FFFFFF;
}
}
</style>
二、外部导入:
<style type="text/css" media="print">
@import url("pagePrint.css");
</style>
三、外部链接:
<link rel="stylesheet" type="text/css" href="pagePrint.css" media="print" />