Does the @page in CSS be used for printing? What's the effect?

Source: Internet
Author: User
Does the @page in CSS be used for printing? Can't show its effect with IE?
If you can show the effect please give a specific example

The use of @page is not found, we suggest you look at the following:

Using CSS, define a. Noprint class to put the non-printed content into this class. Details are as follows:

<style media=print type= "Text/css" >    . Noprint{visibility:hidden}    </style>

The content to print. Ha ha!

<p class= "Noprint" >

Place the non-printable code here.

</p> <a href= "Javascrīpt:window.print ()" target= "_self" > Print </a>

The second method: Specify the print area to place the content you want to print into a span or div, and then print it through a function.

<span id= ' Div1 ' > put the content you want to print here </span> <p> All content </p> <div id= "div2" >div2 content </div> < A href= "Javascrīpt:printme ()" target= "_self" > Print </a> <scrīpt language= "javascrīpt" > Function Printme () {      Document.body.innerhtml=document.getelementbyid (' Div1 '). innerhtml+ ' <br/> ' +document.getelementbyid ( ' Div2 '). InnerHTML;      Window.print (); } </scrīpt>

If you want to print only a small part of the entire page, it's best to take the second approach.

Third method: If the page layout to be printed differs greatly from the original Web page, this method is used. Click the Print button to pop up a new window, display the content you want to print to a new window, call the Window.print () method in a new window, and then close the new window automatically.

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.