Home > Web Front-end > HTML Tutorial > About the style issue of page printing window.print()_html/css_WEB-ITnose

About the style issue of page printing window.print()_html/css_WEB-ITnose

WBOY
Release: 2016-06-24 11:45:36
Original
1926 people have browsed it

When we print the web page. Sometimes you will find it. Printed out. It's a bit different from the style seen on the web page. There may be problems with this. Style issue.

When calling the print (window.print()) method. The printer will find the style of @media print{} in the style of the web page and adapt it to the web page to be printed.

So if the page you want to print matches the effect of the page you see, it is best to write a set of styles

<style   type="text/css">     /* @media print 为打印时适应的样式表*/  @media   print   {     body   {   font-size:   12px}  ...../*其它的样式*/       }   </style>   
Copy after login

 

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template