运行 ❯
获取您
自己的
网站
×
更改方向
保存代码
更改主题,深色/浅色
转到 Spaces
<!DOCTYPE html> <html> <head> <style> .image { height: 100px; width: 100px; image-rendering: auto; } </style> </head> <body> <h1>Change image-rendering with JavaScript</h1> <p>Click the "Try it" button to change the image-rendering from auto to pixelated:</p> <img id="myIMG" class="image" src="smiley.gif" alt="Smiley" width="32" height="32"> <button onclick="myFunction()">Try it</button> <script> function myFunction() { document.getElementById("myIMG").style.imageRendering = "pixelated"; } </script> </body> </html>