html下拉菜单怎么做?高手教你如何在HTML和CSS中创建下拉菜单


当前第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

<!DOCTYPE html>

<html>

<head>

<style>

.dropbtn {

    background-color: black;

    color: white;

    padding: #px;

    font-size: #px;

    border: none;

}

.dropdown {

    position: relative;

    display: inline-block;

}

.dropdown-content {

    display: none;

    position: absolute;

    background-color: lightgrey;

    min-width: #px;

    z-index: 1;

}

.dropdown-content a {

    color: black;

    padding: #px #px;

    text-decoration: none;

    display: block;

}

.dropdown-content a:hover {background-color: white;}

.dropdown:hover .dropdown-content {display: block;}

.dropdown:hover .dropbtn {background-color: grey;}

</style>

</head>

<body>

<div class="dropdown">

<button class="dropbtn">Name</button>

<div class="dropdown-content">

<a href="http://www.php.cn/">Name</a>

<a href="http://www.php.cn/">Name</a>

<a href="http://www.php.cn/">Name</a>

</div>

</div>

</body>

</html>

效果如图:

微信截图_20181101160147.png

以上就是对html下拉菜单怎么做?高手教你如何在HTML和CSS中创建下拉菜单的全部介绍,如果你想了解更多有关HTML5在线手册,请关注php中文网。

以上就是html下拉菜单怎么做?高手教你如何在HTML和CSS中创建下拉菜单的详细内容,更多文章请关注木庄网络博客

返回前面的内容

相关阅读 >>

html下拉菜单怎么做

html下拉菜单怎么做?高手教你如何在html和css中创建下拉菜单

更多相关阅读请进入《html下拉菜单》频道 >>




打赏

取消

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

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

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

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

评论

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