首页
CSS
CSS 背景
背景附件
尝试一下:随页面滚动的背景图像
运行 ❯
获取您自己的网站
×
更改方向
保存代码
更改主题,深色/浅色
前往 Spaces
<!DOCTYPE html> <html> <head> <style> body { background-image: url("img_tree.png"); background-repeat: no-repeat; background-position: right top; margin-right: 200px; background-attachment: scroll; } </style> </head> <body> <h1>The background-attachment Property</h1> <p>The background-attachment property specifies whether the background image should scroll or be fixed (will not scroll with the rest of the page).</p> <p><strong>Tip:</strong> If you do not see any scrollbars, try to resize the browser window.</p> <p>The background-image scrolls. Try to scroll down the page.</p> <p>The background-image scrolls. Try to scroll down the page.</p> <p>The background-image scrolls. Try to scroll down the page.</p> <p>The background-image scrolls. Try to scroll down the page.</p> <p>The background-image scrolls. Try to scroll down the page.</p> <p>The background-image scrolls. Try to scroll down the page.</p> <p>The background-image scrolls. Try to scroll down the page.</p> <p>The background-image scrolls. Try to scroll down the page.</p> <p>The background-image scrolls. Try to scroll down the page.</p> <p>The background-image scrolls. Try to scroll down the page.</p> <p>The background-image scrolls. Try to scroll down the page.</p> <p>The background-image scrolls. Try to scroll down the page.</p> <p>The background-image scrolls. Try to scroll down the page.</p> <p>The background-image scrolls. Try to scroll down the page.</p> <p>The background-image scrolls. Try to scroll down the page.</p> <p>The background-image scrolls. Try to scroll down the page.</p> <p>The background-image scrolls. Try to scroll down the page.</p> <p>The background-image scrolls. Try to scroll down the page.</p> <p>The background-image scrolls. Try to scroll down the page.</p> <p>The background-image scrolls. Try to scroll down the page.</p> <p>The background-image scrolls. Try to scroll down the page.</p> </body> </html>