我已编写以下代码来打印某个div
var DocumentContainer = document.getElementById('printdiv');
var WindowObject = window.open('', "printwin", "left=100,top=100,width=400,height=400");
WindowObject.document.writeln(DocumentContainer.innerHTML);
WindowObject.document.writeln('<link rel="stylesheet" href="styles/style.css" type="text/css">');
console.log(WindowObject.innerHTML);
WindowObject.document.close();
WindowObject.focus();
WindowObject.print();
WindowObject.close();
它在FF中工作,但没有从 crome 中的样式表获取样式。请你为我提供任何解决方案。谢谢。