【问题标题】:Background image won't scroll with content背景图像不会随内容滚动
【发布时间】:2013-11-22 18:29:12
【问题描述】:

我遇到了一个奇怪的 CSS 问题,这对我来说真是令人头疼。无论我应用什么 CSS,我的背景图像都不会随着页面上的内容滚动。这是我设置的正文 CSS:

background-repeat: no-repeat;
background-position: center top;
background-attachment: scroll;
-webkit-background-size: 100% auto;
-moz-background-size: 100% auto;
-o-background-size: 100% auto;
background-size: 100% auto;
background-image: url('http://sigurros.s3.amazonaws.com/images/tour/sigur-smoke-bg3.jpg');
overflow: scroll;

但背景图像始终固定在滚动上。页面网址:http://sigur-ros.co.uk/tour

有什么想法吗?

非常感谢!

【问题讨论】:

    标签: html css background-attachment


    【解决方案1】:

    reset.css 你有overflow : auto

    删除后,背景会随着页面滚动。

    【讨论】:

      【解决方案2】:

      只需将body 样式下的overflow: scroll 更改为overflow: visible

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2017-05-20
        • 1970-01-01
        • 1970-01-01
        • 2015-04-28
        • 2019-08-16
        • 2018-04-17
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多