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
| <div class="nav-wrap"> <div class="nav-node-ul"> <div class="nav-node-li"><a href="#">One</a></div> <div class="nav-node-li"><a href="#">Two</a> <div class="nav-node-ul dropdown"> <div class="nav-node-li"><a href="#">Sub-1</a></div> <div class="nav-node-li"><a href="#">Sub-2</a></div> <div class="nav-node-li"><a href="#">Sub-3</a></div> </div> </div> <div class="nav-node-li"><a href="#">Three</a></div> </div> </div> <style>
.nav-wrap{ position: absolute; left: 0; }
.nav-wrap a { text-decoration: none; }
.nav-wrap .nav-node-.nav-node-ul { background: darkorange; list-style: none; margin: 0; padding-left: 0; }
.nav-wrap .nav-node-li { color: #fff; background: darkorange; display: block; float: left; padding: 1rem; position: relative; text-decoration: none; transition-duration: 0.5s; } .nav-wrap .nav-node-li a { color: #fff; }
.nav-wrap .nav-node-li:hover { background: red; cursor: pointer; }
.nav-wrap .nav-node-ul .nav-node-li .nav-node-ul { background: orange; visibility: hidden; opacity: 0; min-width: 5rem; position: absolute; transition: all 0.5s ease; margin-top: 1rem; left: 0; display: none; }
.nav-wrap .nav-node-ul .nav-node-li:hover > .nav-node-ul, .nav-wrap .nav-node-ul .nav-node-li:focus-within > .nav-node-ul, .nav-wrap .nav-node-ul .nav-node-li .nav-node-ul:hover { visibility: visible; opacity: 1; display: block; }
.nav-wrap .nav-node-ul .nav-node-li .nav-node-ul .nav-node-li { clear: both; width: 100%; } </style>
|