HTML如何定义搜索栏

发布时间:2022-05-16 发布网站:脚本宝典
脚本宝典收集整理的这篇文章主要介绍了HTML如何定义搜索栏脚本宝典觉得挺不错的,现在分享给大家,也给大家做个参考。

HTML定义搜索栏的方法:首先新建一个div,id名为box;然后在内部添加一个input标签和一个div标签;最后使用css为它们设计样式即可。

HTML如何定义搜索栏

本教程操作环境:windows7系统、html5版,DELL G3脑。

HTML定义搜索栏的方法:

1、首先新建一个div,id名为box,用来包裹搜索框;

2、然后在内部添加一个input标签和一个div标签,一个用来输入文字,一个充当按钮;

3、最后使用css为它们设计样式即可。

<!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>

相关学习推荐:html视频教程

以上就是HTML如何定义搜索栏的详细内容,更多请关注脚本宝典其它相关文章

脚本宝典总结

以上是脚本宝典为你收集整理的HTML如何定义搜索栏全部内容,希望文章能够帮你解决HTML如何定义搜索栏所遇到的问题。

如果觉得脚本宝典网站内容还不错,欢迎将脚本宝典推荐好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。
标签:HTML