And*_*cer 16 css android google-chrome background-attachment
(之前有人问 过,很多次,我知道.但是,它似乎每次都是由不同的事情引起的.我已经完成了四个不同的StackOverflow答案线程并尝试了所有内容.似乎没有什么工作了,所以我相信这是一个新问题.)
无论如何,我有一个HMTL元素,背景图像需要修复,使用 background-attachment:fixed;
我已经将问题转换为更简单的可复制测试,这是一个单独的section元素,设置为200%页面高度,背景是全屏和固定的.
html,body {
    padding:0;
    margin:0;
    height:100%;
    width:100%;
}
section {
    background-position:center center;
    background-attachment:fixed;
    background-size:cover;
    background-image:url(http://www.andymercer.net/wp-content/themes/andymercer/images/background/home.png);
    height:200%;
    width:100%;
}<section>Test</section>为了便于在智能手机上进行测试而不是代码片段:http://jsfiddle.net/LerLz1L2/
backface-visibility: hidden;-webkit-backface-visibility:inherit;-webkit-transform: translate3d(0,0,0);position:static小智 7
下面的代码在android chrome中对我很好.
html {
  height: 100%;
  background: url(bg.jpg) no-repeat center center fixed;
  -webkit-background-size: cover;
  -moz-background-size: cover;
  -o-background-size: cover;
  background-size: cover;
}
我从这里得到了这个
小智 1
这适用于除原生 Android 浏览器之外的几乎所有浏览器
background-image:url(http://www.andymercer.net/wp-content/themes/andymercer/images/background/home.png);
background-repeat: no-repeat;
background-position: center center;
background-attachment: fixed;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover !important;
max-width:100%;
max-height:100%;
width:auto;
强烈建议先设置图片url
寻找 Android 浏览器上的错误(后台附件:已修复)的解决方案。
希望有帮助!
| 归档时间: | 
 | 
| 查看次数: | 12261 次 | 
| 最近记录: |