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

<!DOCTYPE html>

<html>

<head>

<title>document</title>

<meta charset="utf-8">

<style>

.dropdown {

    position: relative;

    display: inline-block;

}

.dropdown-content {

    display: none;

    position: absolute;

    background-color: #f9f9f9;

    min-width: 160px;

    box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);

    padding: 12px 16px;

}

.dropdown:hover .dropdown-content {

    display: block;

}

</style>

</head>

 

<body>

<div class="dropdown">

    <span>鼠标移动到这里,会出现下拉列表</span>

    <div class="dropdown-content">

        <p>表单一</p>

        <p>表单一</p>

    </div>

</div>

</body>

</html>

效果:

GIF.gif

推荐学习:css视频教程

以上就是css如何实现下拉菜单的详细内容,更多文章请关注木庄网络博客

返回前面的内容

相关阅读 >>

css怎么去掉焦点框

css如何实现自适应分隔线?方法介绍

css怎么把正方形变成圆形

“margin:0 atuo;” 是什么意思?

border属性怎么用

css中变量的的用法介绍(附示例)

内联css写法是什么

什么是css盒子模型?

vs如何创建css文件

css background-image属性怎么用

更多相关阅读请进入《css》频道 >>




打赏

取消

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

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

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

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

评论

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