我使用以下代码打印页面的特定部分。它在Firefox中运行良好但在Google Chrome和IE中无效。在print.css
中,我将部分内容显示为无。
控制器 - 社区 主题 - css --- print.css
var prtContent = document.getElementById('detailleft');
var WinPrint = window.open('', '', 'letf=10,top=10,width=600",height="250",toolbar=1,scrollbars=1,status=0');
WinPrint.document.write("<html><head><LINK rel=\"stylesheet\" type\"text/css\" href=\"/../../Themes/css/print.css\" media=\"print\"><LINK rel=\"stylesheet\" type\"text/css\" href=\"/../../Themes/css/print.css\" media=\"screen\"></head><body>");
WinPrint.document.write(prtContent.innerHTML);
WinPrint.document.write("</body></html>");
WinPrint.document.close();
WinPrint.focus();
WinPrint.print();
WinPrint.close();