【前端】表单自适应

写前端页面的时候难免遇到表单的样式自适应,文字+input,文字数量又不确定,表单还要自适应某个div的宽度

表单1

表单2


<style>
	.col{  48%; height: 34px; float: left; }
	.label{ float: left; line-height: 34px; text-align: right;  90px; }
	.input{ margin-left: 90px; }
	.input input{  100%; box-sizing: border-box; height: 34px; border: 1px solid #ccc; border-radius: 3px; }
</style>
<div>
	<div class="col">
		<span class="label">姓名:</span>
		<div class="input">
			<input type="text">
		</div>
	</div>
	<div class="col">
		<span class="label">身份证号码:</span>
		<div class="input">
			<input type="text">
		</div>
	</div>
</div>

原文地址:https://www.cnblogs.com/jarjune/p/9683537.html