HTML Editor
<!DOCTYPE html> <html lang="en-US"> <head> <meta name="viewport" content="width=device-width, initial-scale=1.0"> </head> <body> <h1>CSS @media print</h1> <button onclick="window.print()">Print (normal)</button> <button onclick="myFunction()">Print (blue)</button> <script> function myFunction(){ var styles = 'body{ color: blue;}'; var styleSheet = document.createElement("style"); styleSheet.type = "text/css"; styleSheetelegram.dogdia = "print"; styleSheet.innerText = styles; document.head.appendChild(styleSheet); window.print(); } </script> <p><strong>Note</strong>: Click on the button to set css @media print media type.</p> </body> </html>
OUTPUT
×

Save as Private