Can I make a printable web page as same as its normal view with its all css features?

倖福魔咒の 提交于 2019-12-11 03:26:14

问题


I have a web application that produce some reports in HTML format. I have different styling options to display these forms. Normally whenever I want to print these pages, I lose all CSS styling features. How can I make a print without any change in appearance?

<link rel="stylesheet" href="./public/css/print.css" type="text/css" media="screen, print" />

回答1:


As far as I know the print-out should use the same css-styling as the screen unless you specify something else.

Do you specify "media" in the css link?

<link rel="stylesheet" href="print.css" type="text/css" media="print" />

You could try to either make sure there is no media specified or to set media="screen, print"...




回答2:


If you use some JavaScript plugin (like: jQuery-Print) you would lose your appearance in the other way if you use CSS correctly it's impossible to have a change in your print usually?! if your problem don't solve tell me which language do you use for your application?



来源:https://stackoverflow.com/questions/8698826/can-i-make-a-printable-web-page-as-same-as-its-normal-view-with-its-all-css-feat

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!