【发布时间】:2014-06-29 11:33:51
【问题描述】:
我有一个网页,其中顶部标题像许多网页一样固定,而其他正文内容有时可能有滚动条。 我已打开浏览器的自动完成功能。 我有一些文本框来接受用户输入。单击文本框时,它会打开自动完成下拉菜单,其中包含用户先前输入的值。现在,如果我滚动页面文本框正在移动,但自动完成下拉菜单没有。 问题在于 IE 和 Chrome。
以下是示例代码(插入更多空白行以在浏览器上创建滚动条):
<html>
<head>
<style type="text/css">
body,div {
margin: 0;
padding: 0;
}
body {
/* Disable scrollbars and ensure that the body fills the window */
width: 100%;
height: 100%;
}
#main {
/* Provide scrollbars if needed, position below header, and derive height from top/bottom */
overflow: auto;
position: absolute;
width: 100%;
top: 200px;
bottom: 0;
}
</style>
</head>
<body>
<div style='position:absolute;top:0px:left:0px;'>
<span> This is fixed content2</span>
</div>
<div id="main">
<pre>
<form id="myform" action="http://www.google.com">
<a href="www.google.com">Google</a>
<input type="submit"/>
<input type="text" name="t" id="t"/>
<select name="sel">
<option>12</option>
<option>13</option>
<option>22</option>
<option>45</option>
</select>
</form>
</pre>
</div>
</body>
</html>
【问题讨论】:
标签: html css autocomplete scroll floating