我创建了一个测试网页,展示了Mobile Safariposition:fixed
上的问题:UIWebView
<!DOCTYPE html>
<html style="overflow: hidden; ">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.2, user-scalable=no">
<title>Test</title>
<style type="text/css">
* {
-webkit-tap-highlight-color: rgba(0,0,0,0);
}
body {
margin: 0px;
padding: 0px;
}
.fullscreen {
background: transparent;
display: block;
position: absolute;
top: 0; left: 0;
width: 100%;
height: 100%;
}
.screen {
position: fixed;
left: 0px;
top: 0px;
width: 100%;
height: 100%;
/*-webkit-box-shadow: inset 0 0 10px #0d1f2b;
-moz-box-shadow: inset 0 0 10px #0d1f2b;
-o-box-shadow: inset 0 0 10px #0d1f2b;*/
box-shadow: inset 0 0 10px #0d1f2b;
}
</style>
</head>
<body>
<div class="screen" id="screen"></div>
<form><textarea id="code" name="code" class="fullscreen" rows="1">
1
2
3
4
5
6
7
8
9
0
1
2
3
4
5
6
7
8
9
0
1
2
3
4
5
6
7
8
9
0
1
2
3
4
5
6
7
8
9
0
1
2
3
4
5
6
7
8
9
0
1
2
3
4
5
6
7
8
9
0
1
2
3
4
5
6
7
8
9
0
1
2
3
4
5
6
7
8
9
0
1
2
3
4
5
6
7
8
9
0
</textarea></form>
</body>
</html>
重现步骤:
- 在 iPad 或 iPhone 上的 Mobile Safari 上打开演示网页。
- 点击文本区域以显示键盘。
- 向上或向下滚动以查看问题。
嵌入阴影应该沿着浏览器窗口的边缘,但它错误地位于页面下方。
我怎样才能使position:fixed
工作正常?