🔥码云GVP开源项目 12k star Uniapp+ElementUI 功能强大 支持多语言、二开方便! 广告
``` <!DOCTYPE html> <html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <style> .open_menu { height: 100%; width: 0; position: fixed; z-index: 1; top: 0; right: 0; background-color: #111; overflow-x: hidden; transition: 0.5s; padding-top: 60px; } .open_menu a { padding: 8px 8px 8px 32px; text-decoration: none; font-size: 25px; color: #818181; display: block; transition: 0.3s; } .open_menu a:hover { color: #f1f1f1; } .open_menu .open_closebtn { position: absolute; top: 0; right: 25px; font-size: 36px; margin-left: 50px; } .open_icon { position: absolute; font-size:30px; cursor:pointer; right: 30px; top: 10px; } @media screen and (max-height: 450px) { .open_menu {padding-top: 15px;} .open_menu a {font-size: 18px;} } </style> </head> <body> <div id="myopen_menu" class="open_menu"> <a href="javascript:void(0)" class="open_closebtn" onclick="closeNav()">&times;</a> <a href="#">About</a> <a href="#">Services</a> <a href="#">Clients</a> <a href="#">Contact</a> </div> <span class="open_icon" onclick="openNav()">&#9776;</span> <script> function openNav() { document.getElementById("myopen_menu").style.width = "250px"; } function closeNav() { document.getElementById("myopen_menu").style.width = "0"; } </script> </body> </html> ```