【问题标题】:Why background image width stretch longer than screen (browser)?为什么背景图像宽度比屏幕(浏览器)长?
【发布时间】:2014-12-10 05:38:25
【问题描述】:

我的网站是响应式的,但我的背景图像的拉伸时间比屏幕(或浏览器)长,这使得浏览器底部有滚动条,因为右侧有额外的部分宽度?我的主要内容是响应式的。所以这个额外的部分只是背景图像。 如果我添加“背景重复:不重复;”然后右侧仍然有额外的白色部分,仍然使它具有滚动条 如果我删除了背景图像,还会有一个额外的白色部分向右拉伸。

这是我的 style.css

html {
    -webkit-font-smoothing: antialiased;
    text-rendering:optimizeLegibility;
}

body {
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
    font-size: 14px;
    color: black;
    background: url(../images/wood_background.jpg);
}

【问题讨论】:

    标签: background repeat stretch


    【解决方案1】:

    您可以使用调整宽度

    例如:background:size:100% 100%

    您可以调整百分比,以便相应地调整您的图像

    【讨论】:

    • 我试过了,但没用。感谢您的帮助
    猜你喜欢
    • 2014-07-21
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-09-07
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多