Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我的身体标签有这个 css
background: url(images/homepagebg.jpg) no-repeat center;
但它在页面底部停止。图像足够高,可以填满我的整个屏幕。
有任何想法吗?
如果整个屏幕都被内容用完,HTML 正文只会覆盖整个屏幕。
你可以试试
body{ min-height: {height-of-your-image-in-pixels}px; }
我找到了解决方案,我不得不将 fixed 添加到背景属性的末尾,例如
background: url(images/homepagebg.jpg) no-repeat center center fixed;