W3School TIY Editor
W3School 在线教程
改变方向
暗黑模式
运行代码
<html> <head> <style type="text/css"> img { position:absolute; top:100px; } </style> <script type="text/javascript"> function clipImage() { document.getElementById("img1").style.clip="rect(0px,50px,50px,0px)"; } </script> </head> <body> <img id="img1" border="0" src="/i/eg_sun.gif" /> <input type="button" onclick=clipImage() value="Clip image" /> </body> </html>