简体   繁体   English

CSS 背景不会在移动设备上调整大小,但在所有桌面浏览器上都可以调整大小

[英]CSS background not resizing in mobile but resize works on all desktop browsers

I have a background image that will not resize in mobile.我有一个不会在移动设备中调整大小的背景图片。 By all accounts it seems it should work as it resizes in every browser user-agent app I can find.从各方面来看,它似乎应该可以工作,因为它可以在我能找到的每个浏览器用户代理应用程序中调整大小。 Here is my code...这是我的代码...

Header meta...标题元...

<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">

CSS CSS

.row-feature.row-feature-primary {
background: url(../images/lonelygirl2.png) no-repeat center top fixed;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover; 
}

I am using Joomla, and I'm linking this to a module class.我正在使用 Joomla,并将其链接到一个模块类。

This should not be a problem, and probably not due to the CSS.这应该不是问题,可能不是由于 CSS。 I would consider reformatting the CSS like this:我会考虑像这样重新格式化 CSS:

.row-feature.row-feature-primary {
    background-image: url(../images/lonelygirl2.png);
    background-repeat: no-repeat;
    background-position: center top;
    -webkit-background-size: cover;
    -moz-background-size: cover;
    -o-background-size: cover;
    background-size: cover; 
}

暂无
暂无

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

相关问题 适用于所有浏览器的CSS弹出框 - CSS Pop up box that works in all browsers 登录适用于桌面但不适用于移动设备 - Login works on desktop but not mobile? 使用的动态建议列表 <ul><li> 在所有浏览器的桌面上都可以正常工作,但在iPhone移动设备上不能正常工作 - dynamic suggestion list using <ul><li> working fine on desktop for all browsers, but not working on iphones mobile devices 仅检测使用“桌面模式”浏览器的移动用户 - Detect Only Mobile Users with "Desktop Mode" Browsers Google Charts在桌面浏览器上不起作用,但在移动浏览器上很好 - Google Charts Not working on Desktop Browsers, but fine on Mobile Browsers Javascript WebBluetooth 打印机可在台式机/笔记本电脑浏览器上运行,但不能在智能手机浏览器上运行 - Javascript WebBluetooth Printer Works On Desktop / Laptop Browsers But Not Working On Smartphone Browsers 我的样式表仅在移动视图中有效,昨天工作正常但今天如果在桌面上查看,所有样式都消失了 - My stylesheet works only when in mobile view, it worked fine yesterday but today all styles are gone if viewed on desktop 图片上传只能在台式机上进行,而不能通过移动相机进行 - Image upload works on desktop but not from mobile camera 地理位置无法在移动设备上使用,但可以在我的台式机上使用 - The geolocation isnt working on mobile but works on my desktop 移动浏览器绕过elseif语句,但可以在台式机和本地主机上正常运行 - mobile browsers bypassing elseif statements but working fine on desktop and local host
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM