编辑下面的代码:【加编码】
<html> <head> <style> body { background-image:url('img_tree.png'); background-repeat:no-repeat; background-position:right top; margin-right:200px; } </style> </head> <body> <h1>Hello World!</h1> <p>W3Schools background no-repeat, set position example.</p> <p>Now the background image is only shown once, and positioned away from the text.</p> <p>In this example we have also added a margin on the right side, so the background image will never disturb the text.</p> </body> </html>
结果: 【此窗口】 帮助?
Try it Yourself - © 自强学堂