HTML 表单输入文本未显示

新手上路,请多包涵

我的页面没有显示表单中的输入文本。每当我选择文本框时,它都会发光但不接受文本。

我知道我的 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 许可协议

阅读 271
1 个回答

您已将 display : none 添加到 signin id。制作它 display : block 或删除它。此外,对于密码字段,可以使用 input type="password"

原文由 abhiagNitk 发布,翻译遵循 CC BY-SA 3.0 许可协议

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题