【问题标题】:CSS background not resizing in mobile but resize works on all desktop browsersCSS 背景不能在移动设备中调整大小,但调整大小适用于所有桌面浏览器
【发布时间】:2014-03-23 08:14:49
【问题描述】:

我的背景图片不会在移动设备中调整大小。从所有角度来看,它似乎应该可以在我能找到的每个浏览器用户代理应用程序中调整大小。这是我的代码...

标题元...

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

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; 
}

我正在使用 Joomla,并将它链接到一个模块类。

【问题讨论】:

  • 您测试过哪些移动设备? Android、iPhone、平板电脑?
  • Android 和 iPhone。虽然我只有 iPhone 可以测试

标签: php css joomla stylesheet


【解决方案1】:

这应该不是问题,而且可能不是由于 CSS。我会考虑像这样重新格式化 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; 
}

【讨论】:

  • 没问题@Seth,很高兴我能帮上忙!
猜你喜欢
  • 2014-07-10
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2019-04-24
  • 2013-04-19
  • 2013-03-27
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多