W3School TIY Editor
W3School 在线教程
改变方向
暗黑模式
运行代码
<html> <head> <style type="text/css"> body { background-color:#FFCC80; background-image:url(/i/eg_bg_desert.jpg); background-repeat:no-repeat; background-attachment:fixed; } </style> <script type="text/javascript"> function changePosition() { document.body.style.backgroundPosition="bottom center"; } </script> </head> <body> <input type="button" onclick="changePosition()" value="Change background-image position" /> <p><b>Note:</b> For this to work in Mozilla, the background-attachment property must be set to "fixed".</p> </body> </html>