Toggle navigation
Bootsnipp
Bootstrap
For
CSS Frameworks
Bootstrap
Foundation
Semantic UI
Materialize
Pure
Bulma
References
CSS Reference
Tools
Community
Page Builder
Form Builder
Button Builder
Icon Search
Dan's Tools
Diff / Merge
Color Picker
Keyword Tool
Web Fonts
.htaccess Generator
Favicon Generator
Site Speed Test
Snippets
Featured
Tags
By Bootstrap Version
4.1.1
4.0.0
3.3.0
3.2.0
3.1.0
3.0.3
3.0.1
3.0.0
2.3.2
Register
Login
"Hoverable Dropdown Clean code"
Bootstrap 3.0.0 Snippet by
chiraggoyal777
3.0.0
Preview
HTML
CSS
View Full Screen
Fork
Fork this
3.6K
 
1 Fav
Post to Facebook
Tweet this
<link href="//netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css"> <script src="//netdna.bootstrapcdn.com/bootstrap/3.0.0/js/bootstrap.min.js"></script> <script src="//code.jquery.com/jquery-1.11.1.min.js"></script> <!------ Include the above in your HEAD tag ----------> <!Doctype HTML> <div class="container"> <h2>Hoverable Dropdown</h2> <p>Working on advance dropdown.</p> <div class="dropdown"> <button class="dropbutton">Dropdown</button> <ul class="content"> <li id="a1"><a href="#">Link 1</a> <ul> <li><a href="#">Sub link 1</a></li> <li><a href="#">Sub link 2</a></li> <li><a href="#">Sub link 3</a></li> <li><a href="#">Sub link 4</a></li> <li><a href="#">Sub link 5</a></li> </ul> </li> <li id="a2"><a href="#">Link 2</a> <ul> <li><a href="#">Sub link 5</a></li> <li><a href="#">Sub link 6</a></li> <li><a href="#">Sub link 7</a></li> <li><a href="#">Sub link 8</a></li> </ul> </li> <li id="a3"><a href="#">Link 3</a> <ul> <li><a href="#">Sub link 9</a></li> <li><a href="#">Sub link 10</a></li> <li><a href="#">Sub link 11</a></li> <li><a href="#">Sub link 12</a></li> <li><a href="#">Default</a></li> </ul> </li> </ul> </div> <span><h4>This Content will be hidden on dropdown.</h4></span> </div>
/* Universal rule*/ body { height: 700px; margin: 12px; background-color: #f7f9fa; } a { padding: 12px 16px; text-decoration: none; display: block; } a:hover { text-decoration: none; } /* rule ends*/ .dropdown { position: relative; display: inline-block; } span { transition-delay: 0.8s; /* equal to total time line 41 */ } .dropdown:hover + span { visibility: hidden; transition-delay: 0s; } .dropbutton { background-color: #4CAF50; color: white; padding: 16px; font-size: 16px; border: none; cursor: pointer; transition: all 0.4s ease-out 0.4s; } .dropbutton:focus { outline: none; } .dropdown:hover .dropbutton { background-color: #093; transition: all 0.5s; } .content { visibility: hidden; /*Use visibilty: hidden; property instead of Display: none;*/ padding: 0; margin: 0; left: 0; top: 100%; list-style-type: none; position: absolute; background-color: #f7f7f7; min-width: 180px; box-shadow: 0 8px 16px rgba(0,0,0,0.2); z-index: 1; transform: translateY(0); transition: all 0.4s ease-out 0.4s; /*border: 2px solid black;*/ } .dropdown:hover .content { visibility: visible; transform: translateY(10px); transition: all 0.3s ease-out; } .content >li { position: relative; top: 0; border-left: 4px solid transparent; } .content >li:hover { background-color: #cf9; border-left: 4px solid #606; transition: background-color 0.5s; } .content >li ul { visibility: hidden; padding: 0; margin: 0; left: 100%; top: 0; list-style-type: none; position: absolute; background-color: #000; box-shadow: 0 8px 16px rgba(0,0,0,0.2); z-index: 1; min-width: 100px; } .content >li:hover >ul{ visibility: visible; min-width: 200px; transition: all 0.5s; } .content li ul > li:first-child:before { content: "\f0d9"; /* FontAwesome Unicode */ font-size: 28px; font-family: FontAwesome; float: left; top: 4px; left: -8px; position: relative; color: #0d172e; } .content li ul > li:first-child:hover:before { color: #0cf; transition: all 0.5s; } .content li ul > li:not(:first-child){ margin-top: 2px; } .content li ul > li { position: relative; background-color: #0d172e; } .content li ul > li:hover { background-color: #0cf; transition: all 0.5s; }
Questions / Comments:
Post
Posting Guidelines
Formatting
- Now
×
Close
Donate
BTC: 12JxYMYi6Vt3mx3hcmP3B2oyFiCSF3FhYT
ETH: 0xCD715b2E3549c54A40e6ecAaFeB82138148a6c76