我的页面没有显示表单中的输入文本。每当我选择文本框时,它都会发光但不接受文本。
我知道我的 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%;
}
原文由 Abdirahman Haji 发布,翻译遵循 CC BY-SA 4.0 许可协议
您已将
display : none
添加到signin
id。制作它display : block
或删除它。此外,对于密码字段,可以使用input type="password"
。