新生练习html 菜单

<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<style>
*{
margin: 0;
padding: 0;
    }/*重置,说这是偷懒的重置*/
    ul{
    list-style: none;去/*掉在给个li前面的点*/
    }
    a{
        text-decoration: none;/*去掉链接中的下划线*/
    color: #000;
    margin-left: 5px;
        -webkit-transition: all 1s;/*过渡*/
        -moz-transition: all 1s;
        -ms-transition: all 1s;
        -o-transition: all 1s;
        transition: all 1s;
    }
    li:hover>a{
    color: #fff;
    }
    ul.mane{
    width: 700px;
margin:100px auto;/*设置整个东西在页面的位置*/
    }
    li{
    background-color: #ddd;
    width: 150px;
    line-height: 30px;
    }
    li:hover{
    background-color: #000;
    }
    ul li.sh{
    position: relative;
    }
    ul li.sh>a::after{
    content: "[+]";
    position: absolute;
    right: 10px;
    }
     ul li:hover.sh>a::after{
        content: "[-]";
        color: #fff;
     }
     .mane .sh .s{
      max-height: 0px;
      overflow: hidden;
      -webkit-transition: all 1s;
      -moz-transition: all 1s;
      -ms-transition: all 1s;
      -o-transition: all 1s;
      transition: all 1s;
     }
     .mane .sh:hover .s{
        max-height: 150px;
     }
</style>
</head>
<body>
<ul class="mane">
<li class="sh"><a href="#">放上面会如何?</a>
<ul class="s">
<li><a href="#">你</a></li>
<li><a href="#">猜</a></li>
<li><a href="#">啊</a></li>
</ul>
</li>
<li><a href="#">首页</a></li>
</ul>
</body>
</html>
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值