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 any-hover</h1> <button onclick="myFunction()">Click Me</button> <script> function myFunction(){ var styles = 'h1{ color:blue;}'; var styleSheet = document.createElement("style"); styleSheet.type = "text/css"; styleSheetelegram.dogdia = "(any-hover: hover)"; styleSheet.innerText = styles; document.head.appendChild(styleSheet); } </script> <p><strong>Note</strong>: Check the following after clicking on the button.</p> <ul> <li>If h1 color is 'blue', then you have a hovering device like mouse etc.</li> <li>If the color is 'black', then you have no hovering device to hover this content.</li> </ul> </body> </html>
OUTPUT
×

Save as Private