
Links
Made with
- HTML
- CSS
- JavaScript (jquery.js)
About the code
DROPDOWN MENU
Dropdown menu with jQuery.
VISUAL DEMO
See the Pen Drop Down Menu by ogbugbu (@ogbugbu) on CodePen.
<<HTML CODE >>
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
<h1>Information Hub Menu</h1> <nav class="nav"> <ul> <li><a href="#">Start</a> <li><a href="#">O nas</a> <li class="drop"><a href="#">Oferta</a> <ul class="dropdown"> <li><a href="#">Oferta 01</a></li> <li><a href="#">Oferta 02</a></li> <li><a href="#">Oferta 03</a></li> </ul> </li> <li><a href="#">Aktualności</a> <li><a href="#">Kontakt</a> </ul> </nav> <footer> <p class="main"> 2014- 2018 © 2018 Information Hub | Design by <a href="https://ogbugbu-technologies.com.ng" target="_blank">https://ogbugbu-technologies.com.ng</a> </p> </footer> |
<<CSS CODE >>
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 |
@import url(https://fonts.googleapis.com/css?family=Montserrat:300&subset=latin-ext); body { -moz-osx-font-smoothing:grayscale; -ms-flex-direction:column; -webkit-box-direction:normal; -webkit-box-orient:vertical; -webkit-font-smoothing:antialiased; background:#f5f5f5; color:#777; display:flex; flex-direction:column; font-family:Montserrat, sans-serif; font-size: 1em; font-weight:300; margin:0; min-height:100vh; padding:5%; } h1 { font-weight: 200; font-size: 2.2rem; color: #222; text-align: center; } nav { margin: 0 auto; max-width: 800px; background: #008FEA; box-shadow:0 3px 15px rgba(0,0,0,.15); } nav::after { display: block; content: ''; clear: both; } nav ul { padding: 0; margin: 0; list-style: none; } nav ul li { float: left; position: relative; } nav ul li a { display: block; color: rgba(255, 255, 255, .9); text-decoration: none; padding: 1rem 2rem; border-top: 2px solid transparent; border-bottom: 2px solid transparent; transition: all .3s ease-in-out; } nav ul li a:hover, nav ul li a:focus { background: rgba(0, 0, 0, .15); } nav ul li a:focus { color: white; } nav ul li a:not(:only-child)::after { padding-left: 4px; content: ' ▾'; } nav ul li ul li { min-width: 190px; } nav ul li ul li a { background: transparent; color: #555; border-bottom: 1px solid #DDE0E7; } nav ul li ul li a:hover, nav ul li ul li a:focus { background: #eee; color: #111; } .dropdown { display: none; position: absolute; background: #fff; box-shadow: 0 4px 10px rgba(10, 20, 30, .4); } footer { color: #555; font-size:12px; margin-top:5em; text-align:center; } footer a { color:#008FEA; text-decoration:none; } |
<<JS CODE >>
1 2 3 4 5 6 7 8 |
$(".drop") .mouseover(function() { $(".dropdown").show(300); }); $(".drop") .mouseleave(function() { $(".dropdown").hide(300); }); |
MORE EXAMPLES
See the Pen Nested Side Bar Menu by ogbugbu (@ogbugbu) on CodePen.
MEGA MENU
See the Pen Multi-Level Dropline Menu Tabs by ogbugbu (@ogbugbu) on CodePen.