如下图所示,我如何将输入框对齐?
<div style="width:500px;"><span>姓名 *</span><input type="text" name="cec_Firstname" value="" required maxlength="20" /></div> <div style="width:500px;"><span>电话 *</span><input type="text" name="cec_Company" value="" required maxlength="20" /></div> <div style="width:500px;"><span>地址 *</span><input type="text" name="cec_Address" value="" required maxlength="100" /></div> <div style="width:500px;"><span>电子邮件 *</span><input type="text" name="cec_email" value="" required maxlength="50" /></div>
所有的span都加个文中我给的style肯定行
<p><span style="display:inline-block;width:200px;text-align:right;">廉颇:</span> <input type="text" name="" id="" value="" /></p>只要给span一个固定宽度就可以了,当然要把span设置为块儿级元素。