html搜索框怎么设置?html搜索框input标签的使用方法实例


当前第2页 返回上一页

我们来看点更高深的搜索框完整的代码:

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

33

34

35

36

37

38

39

40

41

42

43

44

45

46

<!DOCTYPE html>

<html>

<head>

<meta charset="utf-8">

<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">

<title>PHP中文网</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>

这个代码看效果图:

tuer.png

这个效果就比第一个好看太多了,就是多了点代码,都是基础的css样式的知识,如果有不懂的可以在下方留言。

注意: <input> 元素是空的,它只包含标签属性。

提示: 你可以使用 <label> 元素来定义 <input> 元素的标注。

好了,以上就是关于我们这篇关于html input标签的用法,有问题的可以在下方留言。

【小编推荐】

html空格代码怎么写?html空格代码的表现方式总结

html下拉菜单怎么做?html下拉菜单的代码实例介绍

以上就是html搜索框怎么设置?html搜索框input标签的使用方法实例的详细内容,更多文章请关注木庄网络博客

返回前面的内容

相关阅读 >>

http和html分别指什么

html超链接怎么去掉下划线

怎么修改html文件

html基础图像知识详解

html怎么自动关闭页面

html applet标签怎么用

html中div是什么

html怎么换行?换行代码是什么?九种html文字换行方法总结

html中怎么设置每行文字的间隔

html文件基本结构介绍

更多相关阅读请进入《搜索框》频道 >>




打赏

取消

感谢您的支持,我会继续努力的!

扫码支持
扫码打赏,您说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

分享从这里开始,精彩与您同在

评论

管理员已关闭评论功能...