javascript - Print a div with CSS -


i've been searching alot print div css, didn't output want, don't know why.

here's trigget show print popup:

    <button id="print" onclick="popup('front')">here</button> 

here's script:

    function popup(data) {      var div = document.getelementbyid(data).innerhtml;      var mywindow = window.open('', 'new div', 'height=400,width=600');     mywindow.document.write('<html><head><title></title>');     mywindow.document.write( "<link rel=\"stylesheet\" href=\"ficha-tecnica-media.css\" type=\"text/css\" media=\"print\"/>" );     mywindow.document.write('</head><body >');     mywindow.document.write(div);     mywindow.document.write('</body></html>');      mywindow.print();     mywindow.close();      return true; } </script> 

and in ficha-tecnica-media.css:

@media print {     body{         font-family: arial, helvetica, sans-serif;     }     table{                 font-size: 10px;     }      article{                 font-size: 10px;     }     img{         width: 50px;         height: 50px;     } } 

if put display:none on img works, im trying resize it, doesn't work. font-family in body or font-size don't work.. why?


Comments

Popular posts from this blog

javascript - Laravel datatable invalid JSON response -

java - Exception in thread "main" org.springframework.context.ApplicationContextException: Unable to start embedded container; -

sql server 2008 - My Sql Code Get An Error Of Msg 245, Level 16, State 1, Line 1 Conversion failed when converting the varchar value '8:45 AM' to data type int -