百度搜索框的基本实现 源码
百度搜索框 源码
在搭建个人网站过程中,我们可能想要在页面加入搜索栏以增加网页实用性,本文主要介绍如何在页面加入百度搜索引擎。
首先给一段基础源码:
<html>
<head>
<title>百度搜索框</title>
</head>
<body>
<form id="bdfm" target="_blank" name="bdfm" method="get" action="http://www.baidu.com/s">
<table>
<tr>
<td>
<a href="http://www.baidu.com">
<img src="img/baidu.jpg"/> #请自行下载图片
</a>
</td>
<td><br/><input type="text" id="search1" name="word"/></td>
<td><br/><input type="submit" value="搜索" /></td>
</tr>
</table>
</form>
</body>
<html>
其次就是将代码运用到具体网页中去:
<div class="media-body">
<form id="bdfm" target="_blank" name="bdfm" method="get" action="http://www.baidu.com/s">
<input type="text" class="main-search" id="search1" name="word"/>
</form>
</div>