【问题标题】:body width 100% of page not screen正文宽度 100% 页面不是屏幕
【发布时间】:2012-01-13 02:33:53
【问题描述】:

我的页面正文中的背景图片设置在右下角。但是,当页面中的内容超出屏幕时,背景图像会停在屏幕边缘,而不是实际内容结束的地方。

这是相关的css:

html, body {
    margin : 0;
    padding : 0;
    font-family : arial, sans-serif;
    background-color : #15242d;
    height: 100%;height:auto;
    min-width: 100%;width:auto;
    font-size: 15px;
    color: #959595;
}

body {
    background-image : url(images/body_bkg.gif);
    background-repeat: no-repeat; 
    background-position:right bottom;
}

解决此问题的最佳方法是什么?

【问题讨论】:

    标签: css image background width


    【解决方案1】:

    如果您还没有,您需要将您网站的内容包装在包含div 的内容中,该div 将扩展到内容的大小。然后你需要将背景图片应用到那个div,而不是把它放在body上。

    【讨论】:

    • 我认为他在寻找位于内容右下角而不是屏幕的较小图像。
    • 酷。不值得 -1,我很想看看你想出什么,因为我在 1 分钟的快速尝试中无法搞定。
    • 谢谢你 - 建议比立即投反对票要好得多。显然,我对 OP 的问题的理解是错误的。
    猜你喜欢
    • 2012-08-14
    • 2011-09-30
    • 1970-01-01
    • 2012-04-02
    • 2012-10-19
    • 2013-07-27
    • 2010-11-03
    • 2021-04-19
    • 1970-01-01
    相关资源
    最近更新 更多