Advertisement
Crazykk1449

Website SideNav Code

Mar 18th, 2017
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 2.96 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <style>
  5. body {
  6.     font-family: cursive, sans-serif;
  7. }
  8.  
  9. .sidenav {
  10.     height: 100%;
  11.     width: 0;
  12.     position: fixed;
  13.     z-index: 1;
  14.     top: 0;
  15.     left: 0;
  16.     background-color: #111;
  17.     overflow-x: hidden;
  18.     transition: 0.5s;
  19.     padding-top: 60px;
  20. }
  21.  
  22. .sidenav a {
  23.     padding: 8px 8px 8px 32px;
  24.     text-decoration: none;
  25.     font-size: 25px;
  26.     color: #818181;
  27.     display: block;
  28.     transition: 0.3s
  29. }
  30.  
  31. .sidenav a:hover, .offcanvas a:focus{
  32.     color: #f1f1f1;
  33. }
  34.  
  35. .sidenav .closebtn {
  36.     position: absolute;
  37.     top: 0;
  38.     right: 25px;
  39.     font-size: 36px;
  40.     margin-left: 50px;
  41.     margin-top: 50px;
  42. }
  43.  
  44. @media screen and (max-height: 450px) {
  45.   .sidenav {padding-top: 15px;}
  46.   .sidenav a {font-size: 18px;}
  47. }
  48.  
  49. .myButton {
  50.     background-color:#44c767;
  51.     -moz-border-radius:28px;
  52.     -webkit-border-radius:28px;
  53.     border-radius:28px;
  54.     border:1px solid #18ab29;
  55.     display:inline-block;
  56.     cursor:pointer;
  57.     color:#ffffff;
  58.     font-family:Arial;
  59.     font-size:17px;
  60.     padding:5px 21px;
  61.     text-decoration:none;
  62.     text-shadow:0px 1px 0px #2f6627;
  63. }
  64. .myButton:hover {
  65.     background-color:#5cbf2a;
  66. }
  67. .myButton:active {
  68.     position:relative;
  69.     top:1px;
  70. }
  71.  
  72. #w3schools {
  73.     font-size: 10px;
  74. }
  75.  
  76. </style>
  77. </head>
  78. <body>
  79.  
  80. <div id="mySidenav" class="sidenav">
  81.   <a href="javascript:void(0)" class="closebtn" onclick="closeNav()">&times;</a>
  82.   <a href="http://crazykk1449.weebly.com/index.html">Home</a>
  83.   <a href="http://crazykk1449.weebly.com/contact.html">Contact</a>
  84.   <a href="http://crazykk1449.weebly.com/blogs.html">Blogs</a>
  85.   <a href="http://crazykk1449.weebly.com/videos.html">Videos</a>
  86.   <a href="http://crazykk1449.weebly.com/social-media.html">Social Media</a>
  87.   <a href="http://crazykk1449.weebly.com/other-websites.html">Other Websites</a>
  88.   <a href="http://crazykk1449.weebly.com/other-servers.html">Other Servers</a>
  89.   <a href="#"></a>
  90.   <a href="#"></a>
  91.   <a href="#"></a>
  92.   <a href="#"></a>
  93.   <a href="#"></a>
  94.   <a href="#"></a>
  95.   <a href="#"></a>
  96.   <a href="#"></a>
  97.   <a href="#"></a>
  98.   <a href="#"></a>
  99.   <a href="#"></a>
  100.   <a href="#"></a>
  101.   <a href="#"></a>
  102.   <a href="#"></a>
  103.   <a href="#"></a>
  104.   <a href="#"></a>
  105.   <a href="#"></a>
  106.   <a href="#"></a>
  107.   <a href="#"></a>
  108.   <a href="#"></a>
  109.   <a href="#"></a>
  110.   <a href="#"></a>
  111.   <a href="#"></a>
  112.   <a href="#"></a>
  113.   <a href="#"></a>
  114.   <a href="#"></a>
  115.   <a href="#"></a>
  116.   <a href="#"></a>
  117.   <a href="https://www.w3schools.com/" onclick="window.open(this.href); return false;" onkeypress="window.open(this.href); return false;" id="w3schools">Side nagivator code cortesy of W3Schools.com</a>
  118. </div>
  119.  
  120. <button style="font-size:30px;cursor:pointer" onclick="openNav()" class="myButton">&#9776; Open</button>
  121.  
  122. <script>
  123. function openNav() {
  124.     document.getElementById("mySidenav").style.width = "250px";
  125. }
  126.  
  127. function closeNav() {
  128.     document.getElementById("mySidenav").style.width = "0";
  129. }
  130. </script>
  131.      
  132. </body>
  133. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement