導航:首頁 > 萬維百科 > 設計網頁中怎麼添加搜索欄

設計網頁中怎麼添加搜索欄

發布時間:2021-03-04 00:58:24

1、網頁中百度搜索欄怎麼嵌入的

直接在百度或復好123上下制載百度推廣導航欄,加入到網頁代碼中head標簽中間<iframe src=" http://www.baidu.com/s?wd=test "><iframe>
即可。

2、如何用dreamweaver在網頁上做一個搜索欄

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>無標題文檔</title>

<script type="text/javascript">
function encode(s){
return s.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/([\\\.\*\[\]\(\)\$\^])/g,"\\$1");
}
function decode(s){
return s.replace(/\\([\\\.\*\[\]\(\)\$\^])/g,"$1").replace(/>/g,">").replace(/</g,"<").replace(/&/g,"&");
}
function highlight(s){
if (s.length==0){
alert('搜索關鍵詞未填寫!');
return false;
}
s=encode(s);
var obj=document.getElementsByTagName("body")[0];
var t=obj.innerHTML.replace(/<span\s+class=.?highlight.?>([^<>]*)<\/span>/gi,"$1");
obj.innerHTML=t;
var cnt=loopSearch(s,obj);
t=obj.innerHTML
var r=/{searchHL}(({(?!\/searchHL})|[^{])*){\/searchHL}/g
t=t.replace(r,"<span class='highlight'>$1</span>");
obj.innerHTML=t;
alert("搜索到關鍵詞"+cnt+"處")
}
function loopSearch(s,obj){
var cnt=0;
if (obj.nodeType==3){
cnt=replace(s,obj);
return cnt;
}
for (var i=0,c;c=obj.childNodes[i];i++){
if (!c.className||c.className!="highlight")
cnt+=loopSearch(s,c);
}
return cnt;
}
function replace(s,dest){
var r=new RegExp(s,"g");
var tm=null;
var t=dest.nodeValue;
var cnt=0;
if (tm=t.match(r)){
cnt=tm.length;
t=t.replace(r,"{searchHL}"+decode(s)+"{/searchHL}")
dest.nodeValue=t;
}
return cnt;
}
</script>
<style type="text/css">
.highlight{background:green;font-weight:bold;color:white;}
</style>
</head>
<body>
<form onsubmit="highlight(this.s.value);return false;">
<p><input name="s" id="s" title="搜索內容:"/><input type="submit" value="搜索"/></p>
</form>
<div id="content">
內容
內容
內容
內容
內容
</div>
</body>
</html>

3、如何在自己做的網頁中添加搜索欄

1

4、網頁設計中如何做一個好看的搜索框

通過from表單,將查詢的關鍵詞,通過 like 跟數據進行模糊查詢對比
從topics表中查詢欄位subject與傳進來的參數'$_POST['topic']進行比較模糊查詢
設subject欄位數據為:數學,英語,物理,化學,英文
$subject=$_POST['topic'];
$sql = "select * from topics where subject like '%" .$subject. "%'";
$result = mysql_query($sql);
若從表單提交的『topic』值為「學」,得到的結果將是:數學,化學
多個欄位匹配查詢:
$sql = "select id,subject from topics where (id like '%" .$id. "%') or (name like '%" .$name. "%') or (subject like '%" .$subject. "%') order by id desc";

5、html中搜索框怎麼做

.aa{width:100px; height:20px; boder:solid 1px #f00;}//定義搜索框的大小高度以及邊框顏色。

思路是:
放大鏡圖標用個img寫進來或者用其它回標簽用CSS做背景也可以;
下拉導航答這種效果系統的Select下拉是最容易想到的,但是別想著用它做,,原因很簡單,做不到的,,這個必須藉助JS輔助來解決!

6、dreamweaver網頁製作如何加入搜索框,搜索框功能是可以搜索自已製作的網頁中的內容,能做出來嗎?謝謝

可以製作搜索框,但是如果要實現實際的搜索功能可能就需要用到後台的內容了。僅僅依靠網頁製作,應該是實現不了這個功能的。

7、如何在自己做的網頁中添加百度搜索欄?急!

我給你幾種代碼,你試試,看哪種好。

1、
<iframe id="baiduframe" marginwidth="0" marginheight="0" scrolling="no"
framespacing="0" vspace="0" hspace="0" frameborder="0" width="400" height="90"
src="http://unstat.baidu.com/bn.bsc?tn=hekai_pg&cv=0&cid=1133937&csid=242&bgcr=ffffff&ftcr=000000&urlcr=0000ff&tbsz=335&sropls=1,2,3,4,5,6&kwgp=0">
</iframe>

2、
<iframe id="baiduframe" marginwidth="0" marginheight="0" scrolling="no"
framespacing="0" vspace="0" hspace="0" frameborder="0" width="140" height="75"
src="http://unstat.baidu.com/bn.bsc?tn=hekai_pg&cv=0&cid=1133937&csid=105&bgcr=ffffff&ftcr=000000&urlcr=0000ff&tbsz=80">
</iframe>

3、
<iframe id="baiduframe" marginwidth="0" marginheight="0" scrolling="no"
framespacing="0" vspace="0" hspace="0" frameborder="0" width="200" height="30"
src="http://unstat.baidu.com/bn.bsc?tn=hekai_pg&cv=0&cid=1133937&csid=102&bgcr=ffffff&ftcr=000000&urlcr=0000ff&tbsz=80">
</iframe>

4、
<iframe id="baiduframe" marginwidth="0" marginheight="0" scrolling="no"
framespacing="0" vspace="0" hspace="0" frameborder="0" width="468" height="60"
src="http://unstat.baidu.com/bn.bsc?tn=hekai_pg&cv=0&cid=1133937&csid=106&bgcr=ffffff&ftcr=000000&urlcr=0000ff&tbsz=230&sropls=1,2,3,4,5,6,7,9,10&kwgp=0">
</iframe>

這些是最常用的,你可以試試,就知道是怎麼樣的了,其實沒什麼詳細的解釋。這是框架代碼。

補充:這就是完整的代碼,是百度提供的多種樣式中的4種。現在百度搜索代碼就是框架的形式,所以說這就是完整代碼。

8、html中搜索框怎麼做?

<input type="text" class="aa"><input type="button" value="搜索" class="bb">

與設計網頁中怎麼添加搜索欄相關的知識