无法在HTML页面中聚焦输入字段
我无法通过单击来选择表单中的输入字段。但我可以使用选项卡进行选择。我正在粘贴源代码 如果我将它粘贴到所有div之外,我就能够选择输入元素 我很伤心,因为我不明白为什么这不起作用。 现在我抓挠我的头,因为stackoverflow不允许我将此发布为 我没有太多的细节无法在HTML页面中聚焦输入字段,html,css,forms,Html,Css,Forms,我无法通过单击来选择表单中的输入字段。但我可以使用选项卡进行选择。我正在粘贴源代码 如果我将它粘贴到所有div之外,我就能够选择输入元素 我很伤心,因为我不明白为什么这不起作用。 现在我抓挠我的头,因为stackoverflow不允许我将此发布为 我没有太多的细节 #body{ max-width:1366px;#border:5px dotted black; position:relative; top:75px; z-index:-1; margin:auto; overflow:auto
#body{
max-width:1366px;#border:5px dotted black;
position:relative;
top:75px;
z-index:-1;
margin:auto;
overflow:auto;
overflow-x:hidden;
}
*{
margin:0px;padding:0px;
}
#empty{
float:left;
height:200px;
width:15%;
border:2px double blue;
margin:10px;
}
#big
{
width:80%;
float:left;
overflow:auto;
margin:10px;
border:2px double aqua;
}
#mini
{
margin:20px;
height:400px;
width:250px;
float:left;
display:inline-block;
border:2px groove;
}
<html>
<link rel=stylesheet type="text/css" href="new.css">
<body >
<div id=main_div width=100%>
<div id=body>
<div id=empty>
<form method=get action=login.php>
Username:
<input type=text name=uname value="">
Password:
<input type=password name=pass value="">
<center><input type=Submit value="Log in" name=submit><center>
</form>
</div>
<div id=big>
<div id=mini>
</div>
<div id=log>
</div>
<div id=mini>
</div>
</div>
</div>
</div>
</body>
</html>
您的html结构不正确 从阀体上拆下负z指数:-1
它应该适合您您的html结构不正确 从阀体上拆下负z指数:-1
它应该适用于您您无法选择文本字段,因为z-index:-1您无法选择文本字段,因为z-index:-1您的身体id上有一个z-index:-1删除它,它就可以工作了。我强烈建议你检查一个HTML CSS教程。你的身体id上有一个z-index:-1删除它,它就会工作。我强烈建议您查看HTML CSS教程。