HTML

<h3 onclick="document.getElementsByTagName('nav')[0].className = 'menu menu_active'">menu</h3>
<nav class="menu">
  <p onclick="document.getElementsByTagName('nav')[0].className = 'menu'">close</p>
  <ol>
    <li class="menu-item"><a href="#0">Home</a></li> 
    <li class="menu-item"><a href="#0">About</a></li>
    <li class="menu-item">
      <a href="#0">Widgets</a> 
      <ol class="sub-menu">
        <li class="menu-item"><a href="#0">Big Widgets</a></li>
        <li class="menu-item"><a href="#0">Bigger Widgets</a></li>
        <li class="menu-item"><a href="#0">Huge Widgets</a></li>
      </ol>
    </li>
    <li class="menu-item">
      <a href="#0">Kabobs</a>
      <ol class="sub-menu">
        <li class="menu-item"><a href="#0">Shishkabobs</a></li>
        <li class="menu-item"><a href="#0">BBQ kabobs</a></li>
        <li class="menu-item"><a href="#0">Summer kabobs</a></li>
      </ol>
    </li>
    <li class="menu-item"><a href="#0">Contact</a></li>
  </ol>
</nav>

CSS

body{height:100vh;background:linear-gradient(to right,#c04848,#480048);}
a{color:inherit;text-decoration:none;}
nav{position:fixed;top:calc(50vh - 247px);left:calc(50vw - 150px);padding:25px 35px;width:300px;border-radius:16px;background:#1d1f20;box-shadow:0 0 60px -15px #000;font-size:18px;font-family:"Space Mono",monospace;line-height:1.4;transition:all .75s;transform:scale(0) rotate(360deg);}
nav.menu_active{transform:scale(1) rotate(0);}
nav>ol>li{margin:20px 0;color:#b5bc67;}
nav>ol>li:first-of-type{color:#efc371;}
nav>ol>li>ol{margin:10px 0 0 20px;border-left:1px solid #4d4d4c;color:#ae94c0;}
nav>ol>li>ol>li{margin:7px 0;padding-left:20px;}
nav a:hover{color:#dd925f;}
h3{position:fixed;top:calc(50vh - 40px);left:calc(50vw - 126px);color:#cfd8dc;font-size:60px;font-family:"Roboto Mono",monospace;cursor:pointer;transition:all .3s;}
h3:hover{top:calc(50vh - 50px);padding-bottom:10px;border-bottom:6px dotted #cfd8dc;}
p{float:right;color:#cfd8dc;font-size:16px;font-family:"Roboto Mono",monospace;cursor:pointer;transition:all .2s;}
p:hover{padding-bottom:5px;border-bottom:2px dotted #cfd8dc;}
转载蓝优网



本文最后更新于2018-7-3,已超过一个月没有更新,如果文章内容或图片资源失效,请留言反馈,我们会及时处理,谢谢!
[百度未收录] | [360已收录] | [搜狗已收录]