1、效果演示:(适合手机端还带图标噢 )
2、具体详细代码如下:
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>html输入框宽度高度自适应代码下载</title>
<style type="text/css">
#hehe :focus {
border: 0px;
}
#hehe {
height: 35px;
width: 100%;
border: 0px;
}
#search {
height: 35px;
width: 96%;
border: 1px solid #ccc;
margin-left: 2%;
border-radius: 3px;
margin-top: 7px
}
#search_img {
height: 35px;
width: 25px;
}
</style>
</head>
<body>
<table id="search">
<tr>
<td style="" id="search_img">
<input type="image" src="search.png" style="height: 25px;width: 25px;margin:5px 5px 0px 5px" />
</td>
<td style="height: 35px;">
<input type="text" id="hehe" placeholder="输入搜索信息" />
</td>
</tr>
</table>
</body>
</html>
备注:图标下载地址:http://www.lanrenmb.com/uploads/allimg/170712/618-1FG2125Z30-L.png