我有一个下拉菜单,我需要在移动视图中的页面页脚中创建,我用关闭的菜单和箭头完成了布局,但只是想知道最好的方法是什么让它扩展。它实际上与提供的图像中显示的菜单完全相同。谢谢!
下拉菜单
<!DOCTYPE html>
<html>
<head>
<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);
padding: 12px 16px;
z-index: 1;
}
.dropdown:hover .dropdown-content {
display: block;
}
</style>
</head>
<body>
<h2>Hoverable Dropdown</h2>
<p>Move the mouse over the text below to open the dropdown content.</p>
<div class="dropdown">
<span>Mouse over me</span>
<div class="dropdown-content">
<p>Hello World!</p>
</div>
</div>
</body>
一些答案可以在 https://www.w3schools.com/css/css_dropdowns.asp