调整浏览器大小时如何保持背景定位?
我在网站上使用需要保留在原处的背景图像。除非使用 Firefox 查看页面,否则此操作有效。当 Firefox 窗口的大小小于背景图像时,它开始推动背景。您可以在这里明白我的意思:http://www.dev.arbitersoflight.net/(观看女人的头。)
这是正文的 CSS,其中包含图像:
body {
padding: 0;
margin: 0 auto;
background: #0b0e13 url(/img/backs/bg_tSm.jpg) no-repeat center top;
width: 100%;
display: table;
}
我读过一篇文章,提到这种情况在 Firefox 中发生,并且代码中的两个回车符旨在修复它......但它没有't。提前致谢。
I'm using a background image on my site that needs to stay in place. This works save for when the page is viewed with Firefox. When the Firefox window is sized smaller than the background image it begins to push the background. You can see what I mean here: http://www.dev.arbitersoflight.net/ (Watch the head of the woman.)
Here's the CSS for the body, which contains the image:
body {
padding: 0;
margin: 0 auto;
background: #0b0e13 url(/img/backs/bg_tSm.jpg) no-repeat center top;
width: 100%;
display: table;
}
I read an article that mentioned this is happens in Firefox, and that the two returns in the code are meant to fix it...but it didn't. Thanks in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
几分钟前就开始工作了。解决方法是在 html 样式中添加一个“min-width”,给我:
Got it working a few minutes ago. The fix was to add a "min-width" to the html style giving me: