How to disable printing of pages _css/html
Solution Ideas:
To really prohibit printing pages is not possible, but if you can set the user to print to a blank, but also for the purpose of banning printing.
Specific steps:
code example:
Note: The CSS defined in @media print{} rule is only valid for pages that are printed.
Tip: In many forums when you print a post is a dedicated page to achieve, if you can skillfully use @media print{} rules, you do not have to do a separate page for printing.
Tips:
@media print{} rules can be used for code print as well as all and screen.
Rules like @media are shown in table 2.2.1.
Rule description
@import Specifies the imported external style sheet and target media. The rule must be first declared on the style sheet header
@charset used within an external style sheet file. Specifies the character set used by this style sheet.
@font-face to set OpenType fonts embedded in HTML documents (ie5+ support required)
@media specifying a style sheet rule for the specified media type (requires ie5.5+ support)
Special Tips
Run this example code, and then print the Web page, and the print results will not include "main document content."
Special Instructions
This example uses the @media rule to define the style that the page applies to when printing, which means that the defined CSS is applied to the printer, similar to the print media type:
All applies to all types of devices
Screen display for computer
The above is how to prohibit printing page _css/html content, more relevant content please pay attention to topic.alibabacloud.com (www.php.cn)!