W3School TIY Editor
W3School 在线教程
改变方向
暗黑模式
运行代码
<html> <head> <script type="text/javascript"> function setFloat() { document.getElementById("img1").style.cssFloat="left"; } </script> </head> <body> <img id="img1" src="/i/ct_beatles.jpg" /> <p>This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text.</p> <input type="button" onclick="setFloat()" value="Set image to float to the left" /> </body> </html>