/*flex布局*/
.row{
display: flex
flex-direction: row
}
.row > label{
width: 100px
}
.row > .auto{
flex:1
}
/*常规布局*/
.row:after{
height: 0
display: block
clear: both
}
.row > label{
width: 20%
float: left
}
.row > .auto{
width: 75%
float: right
}
</style>
<div class="row">
<label>1</label>
<input class="auto" type="text" />
</div>
<div class="row">
<label>1</label>
<input class="auto" type="text" />
</div>
<div class="row">
<label>1</label>
<input class="auto" type="text" />
</div>
<div class="row">
<label>1</label>
<input class="auto" type="text" />
</div>
上面的flex布局有兼容性,某些浏览器不支持。