html - 如何在输入标签之前显示标签
问题描述
我试图在 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>
推荐阅读
- jena - 无法在 Fuseki 上运行 openllet
- laravel - 如何在laravel中检索有限数量的相关模型并按相关模型对集合进行排序?
- autodesk-forge - Forge Viewer 中配置的按键列表
- c# - C# SqlDataAdapter - 选择命令关注点
- ionic-framework - 在页面弹出离子4时发送参数
- javascript - 有没有办法根据宽度截断字符串?
- amcharts4 - AmCharts4 值不存在
- android - 通用静态常量
- python - ImportError:无法从“matplotlib”导入名称“样式”
- c - 如何在不等待进一步输入/换行的情况下读取固定长度的字符串?