简体   繁体   English

Opencart背景图片/颜色错误

[英]Opencart Background Image/Colour Error

Afternoon Stack overflow, 下午堆栈溢出,

My issue is with my website here 我的问题是我的网站在这里

I'm using a module for the background image which works perfectly well on desktop computers and ipads, When a mobile user looks over the website, The background image which is maxed at 4000px stops and displays a white background instead. 我使用的背景图片模块在台式机和ipad上效果很好,当移动用户浏览网站时,背景图片(最大4000px)停止显示白色背景。 I've tied @media fixes but have had no luck. 我捆绑了@media修复程序,但是没有运气。 The only fix i found overlayed the content area remove the dripping effect at the top. 我发现覆盖内容区域的唯一解决方法是消除顶部的滴落效果。

Device comparison 设备比较

Thanks again, Steven 再次感谢,史蒂文

Solution: 1- Give background:#000; 解决方案:1-给background:#000; to the body in mobile situation(media query) 在移动情况下到达body (媒体查询)

body {
    background: url('http://www.vapescotts.co.uk/image/catalog/Background_Img/background_black.png') no-repeat center top #000 !important;
}

2-Give background-size: cover !important; 2-give background-size: cover !important; to the body in mobile situation(media query) 在移动情况下到达body (媒体查询)

body {
    background: url('http://www.vapescotts.co.uk/image/catalog/Background_Img/background_black.png') no-repeat center top #000 !important;
background-size: cover !important;
}

You could just give 你可以给

#content { background-color:#000; padding-bottom:30px; }

and remove 并删除

footer { margin-top:30px; }

Gives the same visual effect as if the image had covered it all. 产生与图像覆盖所有图像相同的视觉效果。

Your background is just not responsive that is the issue here.I suggest trying to fix your backgound image 您的背景反应迟钝,这就是问题所在。我建议尝试修复背景图像

background: url(http://www.vapescotts.co.uk/image/catalog/Background_Img/background_black.png) no-repeat center center fixed;
    -webkit-background-size: cover;
    -moz-background-size: cover;
    -o-background-size: cover;
    background-size: cover;

Try putting this on your site As you can see it picks up the image and its responsive and everything in the background is responsive. 尝试将其放置在您的网站上,您可以看到它拾取了图像并且响应迅速,并且后台的所有内容都响应了。 Just play around with your background image make it smaller since its cutting in half ways from top to bottom 只需玩弄您的背景图像即可,因为它从顶部到底部的一半切开了,使其变小了

EDIT: 编辑:

Your image is 1920x4252 ,make it 1920x1080 or something similar. 您的图片是1920x4252,将其设为1920x1080或类似的图片。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM