【前端】表单自适应


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

表单1

表单2


<style>
	.col{ width: 48%; height: 34px; float: left; }
	.label{ float: left; line-height: 34px; text-align: right; width: 90px; }
	.input{ margin-left: 90px; }
	.input input{ width: 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>


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM