似乎背景固定的 CSS 属性在 Jelly Bean WebView 中无法正常工作(无论是在应用程序中还是使用默认的 Android 浏览器)。
如果我设置此属性,则背景图像会加载到内容之上,即内容位于背景图像后面。
这是我的相关 HTML 代码:
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="viewport" content="target-densitydpi=device-dpi">
<meta name="viewport" content="initial-scale=1.0">
<link rel="stylesheet" type="text/css" href="./gesture-background_files/genre-channel-background.css">
<style type="text/css"></style></head>
<body>
<div id="right-keys">
<a href="keypress://1"><img src="./gesture-background_files/one.png"></a><br />
Film24<br />
</div>
<div id="right-keys-vertical">
<a href="keypress://1"><img src="./gesture-background_files/one.png"></a><br />
Film24<br />
</div>
<div id="footer">
MUSCADE<span class="large">EPG</span>
</div>
</body>
</html>
这是 CSS 的相关部分:
body {
background-image: url(hot-black-background.jpg);
background-color: black;
background-repeat: no-repeat;
background-attachment: fixed;
background-position: bottom left;
}
#right-keys, #right-keys-vertical {
position: absolute;
right: 10px;
width: 100px;
text-align: center;
text-shadow: black 2px 2px 0px;
}
#right-keys img, #right-keys-vertical img {
height: 90px;
margin-bottom: 0;
}
#footer {
position: absolute;
right: 10px;
bottom: 10px;
font-size: 20px;
}
它有点长,但唯一重要的部分是CSS 文件顶部的background-attachment
和属性。background-position
如果我删除这些,一切正常。
这是一个已知的错误?任何人都可以提出解决方法吗?
这是该文件的链接,因此您可以尝试从 Jelly Bean 本地浏览器(不是 Chrome)打开它:
http://212.92.197.78/gesture/gesture-background.htm