Run ❯
Get your
own
website
Result Size:
625 x 565
×
Change Orientation
Save Code
Change Theme, Dark/Light
Go to Spaces
<!DOCTYPE html> <html> <body style="background-image:url('img_tree.png');background-repeat:no-repeat;"> <h1>HTML Style Object</h1> <h2>The backgroundPosition Property</h2> <button type="button" onclick="myFunction()">Position background image</button> <script> function myFunction() { document.body.style.backgroundPosition="top right"; } </script> </body> </html>