HTML連載71-翻轉菜單練習

1、翻轉菜單練習​html

 

<!DOCTYPE html>

<html lang="en">

<head>

    <meta charset="UTF-8">

    <title>D174_OverturnMenu</title>

    <style>

        *{

            margin:0;

            padding:0;

        }

        ul{

            width: 400px;

            height: 40px;

            margin:0 auto;

            margin-top: 100px;

            background-color: yellow;

        }

        .nav>li {

            list-style: none;

            float:left;

            width: 120px;

            height: 40px;

            margin-left:10px;

            background-color: green;

            line-height: 40px;

            text-align: center;

        }

        .sub{

            /*display: none;!*表明不顯示元素*!*/

        }

        .sub>li{

            list-style: none;

            background-color: red;

            transform:rotateY(180deg);

            transition:all;

            /*opacity: 0;!*透明度,取值0-1*!*/}

        .nav>li:hover .sub li{

            transform:none;

        }

        .nav>li:hover .sub li:nth-child(1){

            transform:none;

            transition-delay:200ms;

        }

        .nav>li:hover .sub li:nth-child(2){

            transform:none;

            transition-delay:400ms;

        }

        .nav>li:hover .sub li:nth-child(3){

            transform:none;

            transition-delay:600ms;

        }

        .nav>li .sub li:nth-child(3){

            transform:none;

            transition-delay:200ms;

        }

        .nav>li .sub li:nth-child(2){

            transform:none;

            transition-delay:400ms;

        }

        .nav>li .sub li:nth-child(1){

            transform:none;

            transition-delay:600ms;

        }

</style>

</head>

<body>

<ul class="nav" >

    <li>一級菜單

        <ul class="sub">

            <li>二級菜單</li>

            <li>二級菜單</li>

            <li>二級菜單</li>

        </ul>

    </li>

    <li>一級菜單</li>

    <li>一級菜單</li>

</ul>

</body>

</html>

 

 

 

2、源碼:git

D174_OverturnMenu.htmlgithub

D173_ShadowOfBoxAndWord.html微信

地址:學習

https://github.com/ruigege66/HTML_learning/blob/master/D174_OverturnMenu.html大數據

https://github.com/ruigege66/HTML_learning/blob/master/D173_ShadowOfBoxAndWord.htmlui

2.CSDN:https://blog.csdn.net/weixin_44630050spa

3.博客園:https://www.cnblogs.com/ruigege0000/.net

4.歡迎關注微信公衆號:傅里葉變換,我的帳號,僅用於技術交流,後臺回覆「禮包」獲取Java大數據學習視頻禮包code

 

相關文章
相關標籤/搜索