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
WBOYOriginal
2016-06-24 11:45:361934browse

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>   

 

Statement:
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