我的页面没有显示来 self 的表单的输入文本。每当我选择文本框时,它都会发光但不接受文本。
我知道我的 CSS 有问题,但我似乎无法找出问题所在。
HTML:
<div class="container" id="signin">
<h2>Sign in</h2>
<form method="post" action="index.html">
<!-- <input style="display:none" type="password" name="fakepasswordremembered"/> -->
<input type="text" name="password" placeholder="Password" >
<br />
<input class="button" type="submit" name="commit" value="Login" />
</form>
</div>
CSS:
a {
text-decoration: none;
position: absolute;
right: 0;
text-align: right;
color: #fff;
}
a:hover {
text-decoration: underline;
}
.container {
position: fixed;
top: 50%;
left: 50%;
width: 55%;
padding: 30px 0;
transform: translate(-50%, -50%);
text-align: center;
color: #fff;
background: rgba(0,0,0,0.3);
}
#signin, #close {
display: none;
}
#signin {
width: 35%;
}
最佳答案
您已将 display : none
添加到 signin
id。让它成为 display : block
或将其删除。此外,对于密码字段,可以使用input type="password"
。
关于HTML 表单输入文本未显示,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35259683/