时间:2024-01-13 23:12:01 | 来源:网站运营
时间:2024-01-13 23:12:01 来源:网站运营
如何通过html和css完成下拉菜单的制作?:我也试一下。<body> <a href="#">Menu</a> <div class="drop-down" id="drop-down"> <ul> <li>Option 1</li> <li>Option 2</li> <li>Option 3</li> <li>Option 4</li> </ul> </div></body>
#HTML CSS 部分代码:html, body{ font-family: Arial, Helvetica, sans-serif; font-size:16px;}a{ display: block; width:50px; border:1px solid #333; background-color:white; padding:3px; text-align: center; text-decoration: none;}a:hover{ background-color:#EEE; }a:focus + .drop-down{ display: inline-block; }.drop-down{ display: none;}ul{ border:1px solid #333; display: inline-block; margin-top:1px; padding:0px;}ul>li{ height: auto; padding: 3px 10px; border-bottom: 1px solid #333; text-align: center; vertical-align: middle;}ul>li:last-child{ border:0px solid transparent;}ul>li:hover{ background-color:#DDD;}
-----------------------------------------------------------------------关键词:完成,通过