编辑下面的代码:【加编码】
<html> <head> <style type="text/css"> h1 {color:#FF0000;} p {color:#0000FF;} body {background-color:#FFEFD6;} </style> <style type="text/css" media="print"> h1 {color:#000000;} p {color:#000000;} body {background-color:#FFFFFF;} </style> </head> <body> <h1>ZiQiangXueTang Example</h1> <p><a href="#" target="_blank">Click here</a> to open this page in a new window (without the tryit part).</p> <p>If you print this page, or open it in print preview, you will see that it is styled with the media="print" stylesheet. The "print" stylesheet contains black text on white background.</p> </body> </html>
结果: 【此窗口】 帮助?
Try it Yourself - © 自强学堂