Warning: error_log(/data/www/wwwroot/hmttv.cn/caches/error_log.php): failed to open stream: Permission denied in /data/www/wwwroot/hmttv.cn/phpcms/libs/functions/global.func.php on line 537 Warning: error_log(/data/www/wwwroot/hmttv.cn/caches/error_log.php): failed to open stream: Permission denied in /data/www/wwwroot/hmttv.cn/phpcms/libs/functions/global.func.php on line 537
文為大家介紹如何使用 CSS 創建一個帶搜索的導航欄。
以下實例均是響應式的。
可以先看下效果圖:
<div class="topnav">
<a class="active" href="#home">主頁</a>
<a href="#about">關于</a>
<a href="#contact">聯系我們</a>
<input type="text" placeholder="搜索..">
</div>
/* 在頂部導航欄中添加黑色背景顏色 */
.topnav {
overflow: hidden;
background-color: #e9e9e9;
}
面就展示幾款用純CSS3制作的搜索框效果,具體如下:
實現代碼:
css:
近項目需求,寫了一個類似百度搜索框的功能。
把代碼整理了一遍,然后分享出來給大家看看,如果有不對的地方請多指教。
實現效果
使用的語言:html,css,JavaScript,jQuery
代碼部分
html部分:
js部分:
全部代碼:
*請認真填寫需求信息,我們會在24小時內與您取得聯系。