html/css如何写出如下搜索框效果,请给出代码
1 回答
素胚勾勒不出你
TA贡献1827条经验 获得超9个赞
首先来张效果图,这是写好的效果
代码如下:
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647 | <!DOCTYPE html> < html > < head > < meta charset = "utf-8" > < meta http-equiv = "X-UA-Compatible" content = "IE=edge,chrome=1" > < title >Examples</ title > < meta name = "description" content = "" > < meta name = "keywords" content = "" > < link href = "" rel = "stylesheet" > < style type = "text/css" > #box{ width: 380px; margin: 30px auto; font-family: 'Microsoft YaHei'; font-size: 14px; } input{ width: 260px; border: 1px solid #e2e2e2; height: 30px; float: left; background-image: url(images/search.jpg); background-repeat: no-repeat; background-size: 25px; background-position:5px center; padding:0 0 0 40px; } #search{ width: 78px; height: 32px; float: right; background: black; color: white; text-align: center; line-height: 32px; cursor: pointer; } </ style > </ head > < body > < div id = "box" > < input type = "text" name = "search" placeholder = "请输入关键字" > < div id = "search" >搜索</ div > </ div > </ body > </ html > |
上面的背景图片也就是那个放大镜需要你自己找下哦纯手打
- 1 回答
- 0 关注
- 1082 浏览
添加回答
举报
0/150
提交
取消