设置外面的div框的宽度为300px,输入框的宽度为240px,button的宽度为60px。border,margin, padding全为0px,为什么button还会跑到下面而不是跟输入框一行呢?
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>test</title>
<style>
body{
background: #E9E8E8;
}
div{
width: 300px;
height: 28px;
}
input[type="text"]{
width: 240px;
height: 28px;
background: white;
border: none;
padding: 0px;
outline: none;
/*float: left;*/
}
input[type="button"]{
width: 60px;
height: 28px;
border: none;
padding-top: 0;
padding-bottom: 0;
outline: none;
background: #c70202;
/*float: left;*/
}
</style>
</head>
<body>
<div>
<input type="text">
<input type="button" value="提交">
</div>
</body>
</html>