简要教程
这是一款使用css3制作的搜索框ui设计效果。这些搜索框在设计上代码简洁,设计风格以扁平风格为主,效果时尚大方。
使用方法
html结构
所有的搜索框的html结构都是在一个form表单中放置一个input和一个提交按钮。
<form>
<input type="text" placeholder="搜索从这里开始...">
<button type="submit"></button>
</form>
css样式
各种搜索框的css代码非常简单,例如第一种效果的搜索框,通过简单的定位即可完成。
.d1 {background: #a3d0c3;}
.d1 input {
width: 100%;
height: 42px;
padding-left: 10px;
border: 2px solid #7ba7ab;
border-radius: 5px;
outline: none;
background: #f9f0da;
color: #9e9c9c;
}
.d1 button {
position: absolute;
top: 0;
right: 0px;
width: 42px;
height: 42px;
border: none;
background: #7ba7ab;
border-radius: 0 5px 5px 0;
cursor: pointer;
}
.d1 button:before {
content: "\f002";
font-family: fontawesome;
font-size: 16px;
color: #f9f0da;
}
其它各种效果的搜索框的实现代码请参考下载文件。
以上就是7种纯css3搜索框ui设计效果的内容。