61,114
社区成员
发帖
与我相关
我的任务
分享
<!DOCTYPE html>
<html>
<head>
<title>title</title>
<style type="text/css">
*{margin:0;padding:0;}
.container{
height:50px;
background:green;
}
.container input{
height:100%;
background:red;
}
.container div{
width:50px;
height:100%;
background:yellow;
display:inline-block;
}
</style>
</head>
<body>
<div class="container">
<input type="text"><div></div>
</div>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<title>title</title>
<style type="text/css">
*{margin:0;padding:0;clear:both;}
.container{
height:50px;
background:green;
}
.container input{
height:100%;
background:red;
border: none; /*方法一*/
/*box-sizing: border-box;*/ /*方法二*/
vertical-align: top;
}
.container div{
width:50px;
height:100%;
background:yellow;
display:inline-block;
}
</style>
</head>
<body>
<div class="container">
<input type="text"><div></div>
</div>
</body>
</html>