douhe1002 2016-09-12 06:38
浏览 99

在打印背景颜色不显示在打印上

 <script type="text/javascript">     
        function PrintDiv() {    
           var divToPrint = document.getElementById('divToPrint');
           var popupWin = window.open('', '_blank', 'width=300,height=300');
           popupWin.document.open();
           popupWin.document.write('<html><head><link href="<?php echo $temp_url;?>/css/bootstrap.min.css" rel="stylesheet" media="print"><link href="<?php echo $temp_url;?>/css/default.css" rel="stylesheet" media="print"><link href="<?php echo $temp_url;?>/js/item-slider/initcarousel-1.css" rel="stylesheet" media="print"><link href="<?php echo $temp_url;?>/font-awesome/css/font-awesome.min.css" rel="stylesheet" media="print"><link href="<?php echo $temp_url;?>/js/select/fancySelect.css" rel="stylesheet" media="print"></head><body onload="window.print()">' + divToPrint.innerHTML + '</html>');
            popupWin.document.close();
                }
     </script>

I am printing a perticular div area in php . but when i print the div all css is working only background css is not working. i tried to solve it with inline css but it's also not working.

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 matlab有关常微分方程的问题求解决
    • ¥15 perl MISA分析p3_in脚本出错
    • ¥15 k8s部署jupyterlab,jupyterlab保存不了文件
    • ¥15 ubuntu虚拟机打包apk错误
    • ¥199 rust编程架构设计的方案 有偿
    • ¥15 回答4f系统的像差计算
    • ¥15 java如何提取出pdf里的文字?
    • ¥100 求三轴之间相互配合画圆以及直线的算法
    • ¥100 c语言,请帮蒟蒻写一个题的范例作参考
    • ¥15 名为“Product”的列已属于此 DataTable