【问题标题】:Background image does repeats on righthandside with bootstrap on Chrome背景图像在 Chrome 上使用引导程序在右侧重复
【发布时间】:2016-04-08 10:37:47
【问题描述】:

我是 bootstrap 新手,并且已经在几个浏览器上测试了我的网页。

当我在 chrome 上从左侧或右侧缩小选项卡的宽度时,图像的一部分被裁剪并放在图像的另一侧。 imgur图片显示问题。

感谢任何帮助或建议!

This is the issue of bootstrap with chrome

My website page with a problem is here

我已将我的 css 代码放在下面:

#header {
    width: 100%;
    min-height: 500px;
    /*height: 50%;*/
    background-image: url("/galleryPhotos/whiteVan2.jpeg");
    margin-top: 0px;
    background-size: cover;
    background-position: 100%;
    background-repeat: no-repeat;
    top: 0px;
    position: relative;
}

【问题讨论】:

    标签: css google-chrome twitter-bootstrap-3


    【解决方案1】:

    尝试将这些添加到您的 css 中,在您的示例中它似乎对我有用。

    -webkit-background-size: cover; //safari chrome
    -moz-background-size: cover; // firefox
    -o-background-size: cover; // opera
    

    这是一个小提琴(虽然不同的图片):https://jsfiddle.net/46zcm0yL/

    【讨论】:

    • 太完美了!谢谢。
    • 很高兴为您提供帮助(标记它已回答以帮助他人并感谢我!:))
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-07-05
    • 1970-01-01
    • 1970-01-01
    • 2014-09-10
    • 1970-01-01
    相关资源
    最近更新 更多