label{
display:inline-block;
width:100px;<!-或者:min-width:100px;-->
}
原来是这样的:
代码为:
</pre><pre name="code" class="html"><p>
<label for="username">用户名</label>
<input type="text" id="username" name="username"/>
</p>
<p>
<label for="password">密码</label>
<input type="password" id="password" name="password"/>
</p>
<p>
<label for="confirm_password">确认密码</label>
<input type="confirm_password" id="confirm_password" name="confirm_password"/>
</p>
发现输入框并没有对齐。