个性搜索框

1.很久之前在网上看到的,就随手保存起来了。

  1 <!DOCTYPE html>
  2 <html lang="en">
  3 <head>
  4     <meta charset="UTF-8">
  5     <meta name="viewport" content="width=device-width, initial-scale=1.0">
  6     <title>8款纯CSS3搜索框</title>
  7
  8     <link href="http://cdn.bootcss.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet">
  9     <link rel="stylesheet" href="style.css">
 10     <style>
 11         * {
 12             box-sizing: border-box;
 13         }
 14
 15         body {
 16             margin: 0;
 17             padding: 0;
 18             background: #494A5F;
 19             font-weight: 500;
 20             font-family: "Microsoft YaHei","宋体","Segoe UI", "Lucida Grande", Helvetica, Arial,sans-serif, FreeSans, Arimo;
 21         }
 22
 23         #container {
 24             width: 500px;
 25             height: 820px;
 26             margin: 0 auto;
 27         }
 28         div.search {padding: 30px 0;}
 29
 30         form {
 31             position: relative;
 32             width: 300px;
 33             margin: 0 auto;
 34         }
 35
 36         input, button {
 37             border: none;
 38             outline: none;
 39         }
 40
 41         input {
 42             width: 100%;
 43             height: 42px;
 44             padding-left: 13px;
 45         }
 46
 47         button {
 48             height: 42px;
 49             width: 42px;
 50             cursor: pointer;
 51             position: absolute;
 52         }
 53
 54         /*搜索框1*/
 55         .bar1 {background: #A3D0C3;}
 56         .bar1 input {
 57             border: 2px solid #7BA7AB;
 58             border-radius: 5px;
 59             background: #F9F0DA;
 60             color: #9E9C9C;
 61         }
 62         .bar1 button {
 63             top: 0;
 64             right: 0;
 65             background: #7BA7AB;
 66             border-radius: 0 5px 5px 0;
 67         }
 68         .bar1 button:before {
 69             content: "\f002";
 70             font-family: FontAwesome;
 71             font-size: 16px;
 72             color: #F9F0DA;
 73         }
 74
 75         /*搜索框2*/
 76         .bar2 {background: #DABB52;}
 77         .bar2 input, .bar2 button {
 78             border-radius: 3px;
 79         }
 80         .bar2 input {
 81             background: #F9F0DA;
 82         }
 83         .bar2 button {
 84             height: 26px;
 85             width: 26px;
 86             top: 8px;
 87             right: 8px;
 88             background: #F15B42;
 89         }
 90         .bar2 button:before {
 91             content: "\f105";
 92             font-family: FontAwesome;
 93             color: #F9F0DA;
 94             font-size: 20px;
 95             font-weight: bold;
 96         }
 97
 98         /*搜索框3*/
 99         .bar3 {background: #F9F0DA;}
100         .bar3 form {background: #A3D0C3;}
101         .bar3 input, .bar3 button {
102             background: transparent;
103         }
104         .bar3 button {
105             top: 0;
106             right: 0;
107         }
108         .bar3 button:before {
109             content: "\f002";
110             font-family: FontAwesome;
111             font-size: 16px;
112             color: #F9F0DA;
113         }
114
115         /*搜索框4*/
116         .bar4 {background: #F15B42;}
117         .bar4 form {
118             background: #F9F0DA;
119             border-bottom: 2px solid #BE290E;
120         }
121         .bar4 input, .bar4 button {
122             background: transparent;
123         }
124         .bar4 button {
125             top: 0;
126             right: 0;
127         }
128         .bar4 button:before {
129             content: "\f178";
130             font-family: FontAwesome;
131             font-size: 20px;
132             color: #be290e;
133         }
134
135         /*搜索框5*/
136         .bar5 {background: #683B4D;}
137         .bar5 input, .bar5 button {
138             background: transparent;
139         }
140         .bar5 input {
141             border: 2px solid #F9F0DA;
142         }
143         .bar5 button {
144             top: 0;
145             right: 0;
146         }
147         .bar5 button:before {
148             content: "\f002";
149             font-family: FontAwesome;
150             font-size: 16px;
151             color: #F9F0DA;
152         }
153         .bar5 input:focus {
154             border-color: #311c24
155         }
156
157         /*搜索框6*/
158         .bar6 {background: #F9F0DA;}
159         .bar6 input {
160             border: 2px solid #c5464a;
161             border-radius: 5px;
162             background: transparent;
163             top: 0;
164             right: 0;
165         }
166         .bar6 button {
167             background: #c5464a;
168             border-radius: 0 5px 5px 0;
169             width: 60px;
170             top: 0;
171             right: 0;
172         }
173         .bar6 button:before {
174             content: "搜索";
175             font-size: 13px;
176             color: #F9F0DA;
177         }
178
179
180         /*搜索框7*/
181         .bar7 {background: #7BA7AB;}
182         .bar7 form {
183             height: 42px;
184         }
185         .bar7 input {
186             width: 250px;
187             border-radius: 42px;
188             border: 2px solid #324B4E;
189             background: #F9F0DA;
190             transition: .3s linear;
191             float: right;
192         }
193         .bar7 input:focus {
194             width: 300px;
195         }
196         .bar7 button {
197             background: none;
198             top: -2px;
199             right: 0;
200         }
201         .bar7 button:before{
202           content: "\f002";
203           font-family: FontAwesome;
204           color: #324b4e;
205         }
206
207         /*搜索框8*/
208         .bar8 {background: #B46381;}
209         .bar8 form {
210             height: 42px;
211         }
212         .bar8 input {
213             width: 0;
214             padding: 0 42px 0 15px;
215             border-bottom: 2px solid transparent;
216             background: transparent;
217             transition: .3s linear;
218             position: absolute;
219             top: 0;
220             right: 0;
221             z-index: 2;
222         }
223         .bar8 input:focus {
224             width: 300px;
225             z-index: 1;
226             border-bottom: 2px solid #F9F0DA;
227         }
228         .bar8 button {
229             background: #683B4D;
230             top: 0;
231             right: 0;
232         }
233         .bar8 button:before {
234             content: "\f002";
235             font-family: FontAwesome;
236             font-size: 16px;
237             color: #F9F0DA;
238         }
239     </style>
240 </head>
241 <body>
242 <div id="container">
243     <div class="search bar1">
244         <form>
245             <input type="text" placeholder="请输入您要搜索的内容...">
246             <button type="submit"></button>
247         </form>
248     </div>
249
250     <div class="search bar2">
251         <form>
252             <input type="text" placeholder="请输入您要搜索的内容...">
253             <button type="submit"></button>
254         </form>
255     </div>
256
257     <div class="search bar3">
258         <form>
259             <input type="text" placeholder="请输入您要搜索的内容...">
260             <button type="submit"></button>
261         </form>
262     </div>
263
264     <div class="search bar4">
265         <form>
266             <input type="text" placeholder="请输入您要搜索的内容...">
267             <button type="submit"></button>
268         </form>
269     </div>
270
271     <div class="search bar5">
272         <form>
273             <input type="text" placeholder="请输入您要搜索的内容...">
274             <button type="submit"></button>
275         </form>
276     </div>
277
278     <div class="search bar6">
279         <form>
280             <input type="text" placeholder="请输入您要搜索的内容...">
281             <button type="submit"></button>
282         </form>
283     </div>
284
285     <div class="search bar7">
286         <form>
287             <input type="text" placeholder="请输入您要搜索的内容...">
288             <button type="submit"></button>
289         </form>
290     </div>
291
292     <div class="search bar8">
293         <form>
294             <input type="text" placeholder="请输入您要搜索的内容...">
295             <button type="submit"></button>
296         </form>
297     </div>
298 </div>
299 </body>
300 </html>
时间: 2024-08-02 13:30:01

个性搜索框的相关文章

WPF—QQ界面(三):联系人搜索框和个性签名一栏的效果实现

由于过年回家,家里没网,好几个月没写了.昨晚刚回实验室,今天接着写. 首先分析搜索框和个性签名一栏的效果: 1.搜索框平常时框内有一行文字用来提示搜索的内容,当鼠标左键单击会使框内文字清空,并有光标闪烁: 2.个性签名一栏平常时也有一行文字,内容就是你的个性签名啦,当鼠标单击时,会使整个框的文字内容全选,此时可以随意更改你的个性签名. 3.两者还有一个共同特点:当鼠标移到搜索框和个性签名框,都会在鼠标的下方出现一行提示文字. 先贴搜索框的代码: 前台: <TextBox x:Name="t

Android零基础入门第62节:搜索框组件SearchView

原文:Android零基础入门第62节:搜索框组件SearchView 一.SearchView概述 SearchView是搜索框组件,它可以让用户在文本框内输入文字,并允许通过监听器监控用户输入,当用户输入完成后提交搜索时,也可通过监听器执行实际的搜索. SearchView默认是展示一个search的icon,点击icon展开搜索框,也可以自己设定图标.用SearchView时可指定如下表所示的常见XML属性及相关方法. 如果为SearchView增加一个配套的ListView,则可以为Se

Android----- 改变图标原有颜色 和 搜索框

本博客主要讲以下两点知识点 图标改变颜色:Drawable的变色,让Android也能有iOS那么方便的图片色调转换,就像同一个图标,但是有多个地方使用,并且颜色不一样,就可以用这个方法了. 搜索框: 一般是EditText实现,本文 实现 TextView图片和文字居中,键盘搜索. 来看看效果图: 图标改变颜色:第一个界面的左边(二维码)和右边(更多)两个实现,我放进去的图片是黑色的,显示出来是白色的. 搜索框:第一个界面的图片和文字居中,还可以设置间距,第二个见面搜索设置键盘搜索按钮,点击搜

模糊查询(类似百度搜索框)

很常见的搜索框,很常用,总结一下,怕自己忘了,使用的是原生的js. 这是原生写的,代码很简单,重要是思路.主要就是用了一个indexOf(),很简单.越简单的东西越难想到,很多人都会想到用正则去做,这样就舍近求远了. html部分: <div id="box"> <input type="text" id="txt" value = ""> <input type="button&quo

微信小程序开发之带搜索记录的搜索框

实现功能:点击搜索框,有搜索记录时以下拉菜单显示,点击下拉子菜单,将数据赋值到搜索框,点击搜索图标搜索,支持清空历史记录,可手动输入和清空查询关键字, UI: wxml: <!--查询历史记录数据--><view class="ddclass" style="margin-left: 50rpx;z-index:80" hidden="{{!StorageFlag}}" style="z-index:100"

POST注入--搜索框

POST注入的分类有很多: 搜索框 登录框 认证框 还有XXXX,总之什么情况就是什么注入 言而总之,都他么一样,不就是POST传数据的时候动点手脚么? 写了个简单的搜索框注入的网页: 代码折叠了,大家展开看 1 <!DOCTYPE html> 2 <html> 3 <head> 4 <title>搜索型注入</title> 5 <meta charset="utf-8"> 6 </head> 7 &l

模拟百度搜索框,输入时显示历史记录

今天写了个小demo,利用本地存储的特点,模拟百度搜索框. 主要知识是利用本地存储的特点,模拟百度搜索时的历史记录显示. 主要HTML代码为 <div class="search"> <input type="text"/> <button class="btn">搜索</button> </div> <ul class="hidden"> <li&

iOS UISearchController 搜索框

#import <Foundation/Foundation.h> @interface Student : NSObject @property(strong,nonatomic) NSString *name; @property(strong,nonatomic) NSString *pic; @property(strong,nonatomic) NSString *tel; -(Student *)initWithDic:(NSDictionary *)dic; +(Student

Android学习笔记(29):搜索框SearchView

SearchView提供一个搜索框,可以监听用户输入,用户提交搜索时,也可以通过监听器执行实际行动. 常用XML属性和相关方法: XML属性 相关方法 说明 android:iconifiedByDefault setIconifiedByDefault(boolean) 设置搜索框是否自动缩小为图标 setSubmitButtonEnable(boolean) 设置是否显示搜索按钮 android:inputType setInputType(int) 设置输入文本格式 android:max