微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

如何在输入标签之前显示标签

如何解决如何在输入标签之前显示标签

我正在尝试在UI中的输入标签之前获取标签。但就我而言,我得到的输出如下图所示。

下面是我的代码示例。 请帮助我进行更改,以便获得所需的输出

我的代码示例:

<form method="post" action="">
    Vector Name: <input name="vectorName" /><br/>
    Vector IP Address: <input type="password" name="ip"/><br/>
    Vector Serial Number: <input type="password" name="serial" /><br/> 
</form>

enter image description here

解决方法

请将您的代码替换为:

.block label{
      display: inline-block;
      width: 180px;
      text-align: right;
}
.block{
  margin-top:10px;
}
<form method="post" action="">
      <div class="block">
          <label>Vector Name:</label>
          <input type="text" name="vectorName" />
      </div>
      <div class="block">
          <label>Vector IP Address:</label>
          <input type="password" name="ip"/>
      </div>
      <div class="block">
          <label>Vector Serial Number:</label>
          <input type="password" name="serial"/>
      </div>
</form>

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。