簡體   English   中英

HTML / CSS - 響應式背景僅適用於Android - Chrome

[英]HTML/CSS - responsive background doesn't work only on Android - Chrome

我的響應背景適用於PC Safari,Chrome,Firefox,Opera。 它在Android上的Firefox中也可以正常工作。 但是在Android上的Chrome中我得到的是這樣的:

在此輸入圖像描述

你知道怎么解決它嗎? 我希望它也能在Android Chrome上全屏顯示。 我試過一切......

CSS和HTML代碼:

 .background { background-image: url("images/bgsky2.jpg"); background-size: cover; background-position: center center; background-repeat: no-repeat; background-attachment: fixed; height: 100%; } 
 <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title></title> <link rel="stylesheet" type="text/css" href="style.css"> <meta name="viewport" content="width=device-width, initial-scale=1"> </head> <body class="background"> </body> </html> 

多年前報道了這個問題!

看到此鏈接將有所幫助:

http://code.google.com/p/android/issues/detail?id=3301

我記得這段代碼幫助了我:

    html{
 height:100%;
 min-height:100%;
}
body{
 min-height:100%;
}

嘗試這個:

   html { 
      background: url(images/bg.jpg) no-repeat center center fixed; 
      -webkit-background-size: cover;
      -moz-background-size: cover;
      -o-background-size: cover;
      background-size: cover;
    }

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM