網頁導航欄滑鼠移上去自動彈出下拉選單

alex_wen2014發表於2017-11-29
<meta charset="UTF-8" />
<div class="menubar"> <div class="menuitem"> <div>選單1</div> <div class="submenu"> <div>子選單1</div> <div>子選單2</div> </div> </div> <div class="menuitem"> <div>選單2</div> <div class="submenu"> <div>子選單1</div> <div>子選單2</div> <div>子選單3</div> </div> </div> <div class="menuend"></div> </div> <p> lsjflsjlajlsa;djflqjwwlejrflsjdlfjwqoo;lnsdl;fgnsl;rjwjeflsdjfljl;jfowei </p> <style type="text/css"> .menubar {line-height: 24px;} .menubar .menuend {clear: both;} .menuitem {background: #fff; border: 1px solid #c00; position: relative; float: left; margin-right: 1em;} .menuitem .submenu {background: #ccc; border: 1px solid #00c; position: absolute; top: 25px; left: -1px; width: 5em;} /** 下面的控制顯示和隱藏 **/ .menuitem .submenu {display: none;} .menuitem:hover .submenu {display: block;} </style>

轉載於:https://www.cnblogs.com/lyd447113735/p/7920555.html

相關文章