很奇葩的问题,元素在IE,firefox中换行显示,但在chrome中正常。
chrome中效果图
firefox和IE效果图
<div class="login">
<h2>登 录 系 统</h2>
<form action="">
<div>
<label for="name">用户名</label>
<input type="text" name="name" autofocus>
</div>
<div>
<label for="password">密 码</label>
<input type="password" name="psw">
</div>
<div>
<label for="code">验证码</label>
<input type="text" name="code" id="code">
</div>
<button id="submit">登录</button>
</form>
</div>
css样式如下
.login div {
border-bottom: 1px solid #FFF;
width: 400px;
margin: 40px auto;
}
.login label {
width: 48px;
float: left;
clear: left;
}
.login input {
outline: none;
background-color: transparent;
margin-left: 50px;
width: 400 - 48 - 50px;
}
服了你。你在三个样式里都添加border:1px solid #00ff00看看。