问题描述
我正在尝试在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>
解决方法
请将您的代码替换为:
.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>