【发布时间】:2012-09-12 15:04:24
【问题描述】:
背景固定的 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
【问题讨论】:
-
提醒我this question。
标签: android css android-webview android-4.2-jelly-bean