letsdisappear letsdisappear - 3 months ago 11
Android Question

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

My responsive background works well on PC Safari, Chrome, Firefox, Opera. It works as well in Firefox on Android. But in Chrome on Android I'm getting something like this:

enter image description here

Do you have any idea how to fix it? I want it to be fullscreen on Android Chrome too. I've tried everything...

CSS and HTML code:



.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>




Answer

This issue was reported meny years ago !

See this link will help :

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

And i remember this code helped me :

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