Print the contents of the div with css

1

I got the help of Stackoverflow to mount a script to print a document, now I have a second problem, the script opens the print page without formatting css . I saw an example here but I could not change it according to what I need, I saw it here:

Sample css being loaded

In the example the css is being loaded by the script, but in my example I have this:

document.getElementById('btn').onclick = function() {   
    var conteudo = document.getElementById('conteudo').innerHTML,
    impressao = window.open('about:blank');
    impressao.document.write(conteudo);
    impressao.window.print();
    impressao.window.close();
};

How can I load css in my example?

    
asked by anonymous 15.09.2015 / 22:01

0 answers