【问题标题】:Fixed background like Twitter?固定背景,如 Twitter?
【发布时间】:2011-11-27 12:15:49
【问题描述】:

在每个 Twitter 个人资料页面上都有固定的背景图片。我怎么能在我的网站上做同样的事情?

我想在 CSS 中找到解决方案

【问题讨论】:

    标签: css twitter background-image fixed


    【解决方案1】:

    你可以为你的图片使用背景附件

    background-attachment:fixed;
    

    试试here

    【讨论】:

    • try it 编辑器的链接让您成为我的第一名。
    【解决方案2】:

    在 CSS 中使用 background-attachment: fixed;。示例 CSS:

    body {
    background-image: url('bg.png');
    background-repeat: no-repeat;
    background-attachment: fixed;
    }
    

    【讨论】:

    • 您是在提问 2 分钟后才回答自己的问题吗?
    • @TomvanderWoerdt 这是允许的。查看元数据上的meta.stackexchange.com/questions/12513/…...
    • 我知道,但是如果您要在 2 分钟后发布答案,为什么还要问一个问题呢? ;-)
    • ;) 很有趣的问题,但我认为没关系,因为 StackOverflow 是一个知识库。 [正如 Jeff Atwood 在播客中反复声明的那样:“这个网站是关于建立一个知识库的。”] 所以帮助其他人。
    【解决方案3】:

    【讨论】:

      【解决方案4】:

      background-attachment:固定应该是技巧。

      http://www.w3.org/wiki/CSS/Properties/background-attachment

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2016-08-19
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多