原理是: 要下拉的容器,默认给样式display:none; hover的时候display:block;
<style type="text/css">
.dropdown {
position: relative;
display: inline-block;
}
.dropdown-content {
display: none;
position: absolute;
text-shadow: 0 8px 16px 0 rgba(0, 0, 0, 0.2);
background-color: #ddd;
min-width: 140px;
z-index: 1;
}
.dropdown:hover .dropdown-content {
display: block;
}
.decs {
text-align: center;
padding: 15px;
}
</style>
<div class="dropdown">
<img src="/TAG/pic/41651.png" width="100px">
<div class="dropdown dropdown-content">
<img src="/TAG/pic/41651.png" width="150px" height="200px">
<div class="decs">coffee</div>
</div>
</div>