CSS
CSS 下拉菜单
图片下拉 - 该实例演示了如何如何在下拉菜单中添加图片。
源代码:
点击运行 »
<html> <head> <title>下拉菜单实例|蜜蜂教程(mifengjc.com)</title> <meta charset="utf-8"> <style> .dropdown { position: relative; display: inline-block; } .dropdown-content { display: none; position: absolute; background-color: #f9f9f9; min-width: 160px; box-shadow: 0px 8px 16px 0px rgba(0, 0, 0, 0.2); } .dropdown:hover .dropdown-content { display: block; } .desc { padding: 15px; text-align: center; } </style> </head> <body> <h2>下拉图片</h2> <p>移动鼠标到图片上显示下拉内容。</p> <div class="dropdown"> <img src="/images/logo.png" alt="Logo" height="50"> <div class="dropdown-content"> <img src="/images/logo.png" alt="Logo" height="100"> <div class="desc">有问题,找小蜜!</div> </div> </div> </body> </html>
运行结果:
点击运行 »