答案 0 :(得分:1)
检查以下代码,看看这是否是您想要的:
.field {
position: relative;
margin-bottom: 20px;
}
.field label {
position: absolute;
min-width: 100px;
border: 1px solid;
border-top-color: #fff;
border-left-color: #fff;
}
.field input[type="text"] {
padding: 10px 10px 10px 110px;
border: 1px solid;
outline: none;
}
<div class="field">
<label for="status">Status</label>
<input type="text" id="status">
</div>
<div class="field">
<label for="givenname">Given Name</label>
<input type="text" id="givenname">
</div>
<div class="field">
<label for="surname">SurName</label>
<input type="text" id="surname">
</div>