HTML 表单输入文本未显示

标签 html css forms text

我的页面没有显示来 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/

相关文章:

ajax - Yii2: Bootstrap 模态表单验证 (Ajax) - 任何关于奇怪行为的见解?

php - 是否可以添加一个链接,在单击时会登录用户?

php - 如何将变量从父模板传递到 Twig 中的子模板?

html - 图像忽略 Div 容器

javascript - $.ajax 显示 "�"而不是重音符号,例如 "é"或 "ã"

javascript - 如何使用 jQuery 修复视差平滑滚动?

javascript - 为什么我需要一个包装函数来递归调用 setTimeout

html - 无法摆脱顶部和底部的阴影

html - 将另一个 css 类应用于元素

javascript - 如何从javascript设置html表单的属性