【问题标题】:How to hide password without changing the format of input box?如何在不改变输入框格式的情况下隐藏密码?
【发布时间】:2018-04-29 23:29:34
【问题描述】:

我正在设计一个登录网页,它看起来像这样:

“123456”是密码。

但是,当我尝试通过将代码更改为来隐藏密码时:

<input Name="Password" type="password" id="Password" placeholder="Password" required="">

密码输入框变成了这样:

那么有什么办法可以隐藏密码但保持输入文本框的格式呢?

这是我的源代码:

<form action="login_singletest.php" method="post">

                <div class="w3_cc">

                </div>
                    <input type="text" class="margin-right" Name="Email" placeholder="Email" required="">
                    <input Name="Password" type="text" id="Password" placeholder="Password" required="">

                    <div class="clearfix"></div>
                    <div class="send-button agileits w3layouts">
                        <button class="btn btn-primary">Log In </button>
                    </div>
                 </form>

【问题讨论】:

  • 检查您的样式表/元素。你应该包含你可能拥有的任何 CSS。
  • 您确定只更改了type 属性吗?
  • @surge10 是的,我只改变了类型。
  • 你不仅改变了类型,下面的答案说你也改变了类。
  • Right..., like I said here 但您宁愿回应其他人,而不是因为您而让一些人被否决而不是在答案下发表评论。嗯,我出去了。顺便说一句,这不是我对答案的反对票(黑人)。

标签: php html css


【解决方案1】:
<input type="email" class="margin-right" Name="Email" placeholder="Email" required>
<input type="password" class="margin-right" type="password" name="Password" placeholder="Password" required>

【讨论】:

    【解决方案2】:

    我的道歉。我的同学给我传递了错误的 css 文件,其中她没有定义“type = password”。现在,在修改 css 文件后一切都解决了。 @FunkFortyNiner 非常感谢你的耐心。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2022-07-28
      相关资源
      最近更新 更多