2014年5月1日 星期四

android 4.4.2 background-position 錯誤

body {
    background-image: url(../images/xx.jpg);
    background-repeat: no-repeat;
    background-color:black;

  
   
    background-position: 0px 400px;
    background-attachment: fixed;
   
    overflow-y: scroll;
}

若是設為
 background-position: bottom;

在4.3是行為正確的...   4.4.2出錯




找到解決方式
haha.html


<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
 <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
 <title>haha test</title>
 <link href="css/haha.css" rel="stylesheet" type="text/css"/>
 <meta name="viewport" content="width=device-width, height= device-height , initial-scale=1.0 , maximum-scale=1.0, user-scalable=no,"/>
 
 
 <style type="text/css">
 @media screen and (min-device-height:592px){
  body{color:#f00;}
 }
 </style>
</head>

<body id="mainArea">
 <div class="test">hahahaa</div>
 
 <div class="haha_background">
 </div>
 
</body>
</html>


haha.css


body {

}

.haha_background {
 position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    right: 0;
 height: 100%;
 background-image: url(../images/xxx.jpg);
 background-color:black;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: bottom;
 background-attachment: fixed;
 overflow-y: scroll;
}

沒有留言:

張貼留言