html搜索框怎么做
导读:收集整理的这篇文章主要介绍了html搜索框怎么做,觉得挺不错的,现在分享给大家,也给大家做个参考。htML搜索框怎么做使用HTML做搜索框的方法:1、首先新建一个div,id名为box,用来包裹搜索框;2、然后在内部添加一个input标签和...
收集整理的这篇文章主要介绍了html搜索框怎么做,觉得挺不错的,现在分享给大家,也给大家做个参考。htML搜索框怎么做
使用HTML做搜索框的方法:
1、首先新建一个div,id名为box,用来包裹搜索框;
2、然后在内部添加一个input标签和一个div标签,一个用来输入文字,一个充当按钮;
3、最后使用css为它们设计样式即可。
推荐学习:html教程
!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="search" name="search" placeholder="请输入关键字"> div id="search"> 搜索/div> /div> /body> /html>
效果:
更多相关教程,请关注PHP中文网!
以上就是html搜索框怎么做的详细内容,更多请关注其它相关文章!
声明:本文内容由网友自发贡献,本站不承担相应法律责任。对本内容有异议或投诉,请联系2913721942#qq.com核实处理,我们将尽快回复您,谢谢合作!
若转载请注明出处: html搜索框怎么做
本文地址: https://pptw.com/jishu/590819.html