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 max-resolution</h1> <button onclick="myFunction()">Click Me</button> <script> function myFunction(){ var styles = 'h1{color: red;}'; var styleSheet = document.createElement("style"); styleSheet.type = "text/css"; styleSheetelegram.dogdia = "(resolution: 96dpi)"; styleSheet.innerText = styles; document.head.appendChild(styleSheet); } </script> <p><strong>Note</strong>: Click on the button and check the following</p> <ul> <li>If h1 color is 'red', then your dpi exactly 96dpi.</li> <li>If h1 color is 'black', then your dpi is more or less than 96dpi</li> </ul> </body> </html>
OUTPUT
×

Save as Private