Jquery 如何使用css打印div?

Jquery 如何使用css打印div?,jquery,html,css,Jquery,Html,Css,我正在尝试打印与我的页面相同的输出。 以下是示例输出: 以下是打印时的输出: 我觉得我的剧本很好。请检查: 函数printDiv() { var divToPrint=document.getElementById('print-print'); var newWin=window.open(“”,'Print-window'); newWin.document.open(); newWin.document.write(“”); newWin.document.write(“”); n

我正在尝试打印与我的页面相同的输出。 以下是示例输出:

以下是打印时的输出:

我觉得我的剧本很好。请检查:


函数printDiv()
{
var divToPrint=document.getElementById('print-print');
var newWin=window.open(“”,'Print-window');
newWin.document.open();
newWin.document.write(“”);
newWin.document.write(“”);
newWin.document.write(“”);
newWin.document.write(“”);
newWin.document.write(“”+divToPrint.innerHTML+“”);
newWin.document.close();
setTimeout(函数(){newWin.close();},10);
}

请在您编写文本“of php”的地方提供代码,我不能。代码太长检查css路径,这可能是错误的,这是唯一的问题,我认为这里的路径是正确的,我已经检查了很多次。