【问题标题】:Fixed background not working固定背景不起作用
【发布时间】:2013-01-01 20:34:47
【问题描述】:

我在几个布局相似的网页上嵌入了相同的 CSS 文件。

这适用于除一个 (http://1a23.com/green/wind.html) 之外的所有网页。

body{  
    background: url('images/TextureBG.jpg') center fixed;  
}

在此页面中,背景只能适合第一个屏幕区域,其余的背景将保持白色。重新渲染网页时(如调整窗口大小、刷新等)背景将定位到当前窗口大小,但其他部分保持白色。

此问题已在多台装有最新版 Chrome 和 Firefox 的计算机上测试。

【问题讨论】:

    标签: css background attachment fixed


    【解决方案1】:

    使用这个

    body {
    background: url('images/TextureBG.jpg') center repeat;
    color: white;
    text-shadow: 0px 0px 5px black;
    font-family: 'Helvetica', "Comic Sans MS";
    }
    

    【讨论】:

      【解决方案2】:

      您有几个 html 错误,如果您先清理它们会很好,所以我们知道没有一个是您的问题的原因。

      http://validator.w3.org/check?uri=http%3A%2F%2F1a23.com%2Fgreen%2Fwind.html&charset=%28detect+automatically%29&doctype=Inline&group=0

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 2017-07-17
        • 2013-10-02
        • 1970-01-01
        • 1970-01-01
        • 2019-12-02
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多