演示:http://www.pcguides.cn/e/search/result/?searchid=40&getvar=1
DIV+CSS布局,兼容IE7、IE6、firefox
搜索模板:
<!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=gb2312" /> <title>教程搜索 - 中国电脑教程网</title> <meta name="keywords" content="教程搜索" /> <meta name="description" content="教程搜索" /> <meta name="copyright" content="(C)2007 龙腾盛世 www.Dragonad.cn" /> <meta name="author" content="Blank" /> <link href="/img/search.css" rel="stylesheet" type="text/css" /> </head>
<body><div id="header"><a href="/"><img src="/img/logo.gif" border="0" /></a><form name="search_news" method="post" action="../../search/index.php" onsubmit="return search_check(document.search_news);"><input type=hidden name=show value="title"><input type=hidden name=tempid value="1"><input name="keyboard" type="text" id="keyboard" value="[!--keyboard--]" size="40"> <input type="hidden" name="show" value="title"><input type="submit" name="Submit22" value=" 搜索 "> <a href="#">帮助</a> | <a href="/search">高级搜索</a><br /><input name="RadioGroup1" type="radio" value="news" checked="checked" />新闻 <input type="radio" name="RadioGroup1" id="radio" value="download" />下载 <input type="radio" name="RadioGroup1" id="radio2" value="photo" />图库 <input type="radio" name="RadioGroup1" id="radio3" value="article" />文章</form></div><div id="info"><span class="name">搜索</span><span class="sinfo">约有<strong>[!--ecms.num--]</strong>项符合<strong>[!--keyboard--]</strong>的查询结果</span></div><br /> 小提示: 无需单击“搜索”,按回车键可节省时间。<br /><div id="slist">[!--empirenews.listtemp--]<!--list.var1-->[!--empirenews.listtemp--]</div><div id="gad">赞助商链接<br /><script type="text/javascript"><!-- google_ad_client = "pub-4796335590709486"; google_ad_width = 160; google_ad_height = 600; google_ad_format = "160x600_as"; google_ad_type = "text"; google_ad_channel = ""; google_color_border = "FFFFFF"; google_color_bg = "FFFFFF"; google_color_link = "000ccc"; google_color_text = "000000"; google_color_url = "008000"; //--> </script> <script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"> </script></div><div id="page">[!--show.page--]</div><div id="bottom"><form name="search_news" method="post" action="../../search/index.php" onsubmit="return search_check(document.search_news);"><input type=hidden name=show value="title"><input type=hidden name=tempid value="1"><input name="keyboard" type="text" id="keyboard" value="[!--keyboard--]" size="40"> <input type="hidden" name="show" value="title"><input type="submit" name="Submit22" value=" 搜索 "><br /><a href="#">搜索帮助</a> | <a href="#">意见反馈</a></form></div><div id="cr"><a href="/">首页</a> - <a href="/search">高级搜索</a> - <a href="#">设为首页</a> - <a href="#">加入收藏</a><br />©2007 龙腾盛世</div></body> </html>
list.var:
<li><h1><a href="[!--titleurl--]" target="_blank">[!--title--]</a></h1><span class="text">[!--smalltext--]…</span><span class="class">栏目:[!--class.name--]</span><span class="t">发布时间:[!--newstime--]</span><span class="url"><a href="[!--titleurl--]" target="_blank">http://www.pcguides.cn[!--titleurl--]</a></span></li>
search.css:
/* CSS Document disinged by Blank */ * { margin: 0; padding: 0; } body { color: #222; font-size: 13px; font-family: arial; line-height: 18px; background-color: white; margin-right: 10px; margin-bottom: 20px; margin-left: 10px; } #header { font-size: 14px; width: 100%; float: left; margin-top: 5px; } #header a { color: #000ccc; } #header img { float: left; } #header form { float: left; padding-top: 12px; padding-bottom: 8px; padding-left: 12px; } #header input { vertical-align: middle; padding-top: 2px; padding-bottom: 2px; } #info { background-color: #e5ecf9; text-indent: 5px; width: 100%; float: left; margin-bottom: 12px; border-top: 1px solid #36c; } .name { font-size: 16px; font-weight: bold; float: left; padding-top: 1px; padding-bottom: 1px; } .sinfo { float: right; padding-top: 1px; padding-right: 10px; } #main { width: 100%; float: left; } #slist { width: 580px; float: left; margin-top: 5px; margin-left: 8px; } #slist li { width: 580px; float: left; margin-top: 10px; margin-bottom: 8px; list-style-type: none; } h1 { font-size: 16px; font-weight: normal; width: 580px; float: left; } h1 a { color: #000ccc; } h1 a:hover { color: #f00; text-decoration: underline; } .text { width: 580px; float: left; } .class { color: #080; float: left; margin-right: 8px; } .class a { color: #77c; } .class a:hover { color: #f00; text-decoration: underline; } .t { color: #080; margin-top: 2px; } .url { color: #080; width: 580px; float: left; margin-top: 2px; } .url a { color: #080; text-decoration: none; } .url a:hover { color: #f00; text-decoration: underline; } #gad { line-height: 35px; text-align: center; float: right; padding-right: 20px; padding-left: 20px; border-left: 1px solid #c2d7ec; } #page { font-size: 14px; text-align: center; width: 100%; float: left; padding-top: 30px; padding-bottom: 30px; } #page b { color: #e01919; } #bottom { font-size: 14px; background-color: #e5ecf9; text-align: center; width: 100%; float: left; margin-top: 8px; margin-bottom: 20px; padding-top: 20px; padding-bottom: 20px; border-top: 1px solid #36c; border-bottom: 1px solid #36c; } #bottom input { margin-bottom: 5px; padding-top: 2px; padding-bottom: 2px; } #cr { font-size: 14px; line-height: 25px; text-align: center; width: 100%; float: left; }
上传以下图片:
|