编辑下面的代码:【加编码】
<html> <head> <style> div { background-image: url('img_tree.png'); background-repeat: no-repeat; width: 400px; height: 400px; border: 1px solid #000000; } </style> <script> function displayResult() { document.getElementById("div1").style.backgroundPosition="center bottom"; } </script> </head> <body> <button type="button" onclick="displayResult()">Position background image</button> <br> <div id="div1"> </div> </body> </html>
结果: 【此窗口】 帮助?
Try it Yourself - © 自强学堂