gpt4 book ai didi

html - 在悬停大型菜单上不显示

转载 作者:行者123 更新时间:2023-11-28 00:35:43 24 4
gpt4 key购买 nike

我试过实现下拉菜单。嗯,悬停在它上面时,颜色会发生变化,但它不会显示下拉内容。我不知道我哪里做错了。即使我尝试将宽度设置为 100%,它仍然没有显示。另外,我也改变了位置。谁能帮我解决这个问题。

/* The dropup container */
.dropup{
float: left;
overflow: hidden;
position: initial;
}

/* Add a red background color to navbar links on hover */
.application-container .image-container:hover, .dropup:hover {
background-color: green;
}

/* Dropup content (hidden by default) */
.dropup-content {
display: none;
position: absolute;
background-color: #f9f9f9;
width: 100%;
left: 0;
bottom:100%;
box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
z-index: 9999999;
}

/* Mega Menu header, if needed */
.dropup-content .header {
background: red;
padding: 16px;
color: white;
}

.image-container:hover + .dropup .dropup-content{
display: block;
}
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">

<div class="container application-container">
<div class="row seven-rows">
<div class="column text-center image-container">
<img src="./images/aoe_icons_services_order_management.png" width='69' height='61' alt="e-commerce">
<p class="mt-2 text-custom">E Commerce</p>
</div>
<div class="dropup">
<div class="dropup-content">
<div class="header">
<h2>Mega Menu</h2>
</div>
<div class="row">
<div class="col-lg-8">
<h3>Category 1</h3>
<a href="#">Link 1</a>
<a href="#">Link 2</a>
<a href="#">Link 3</a>
</div>
<div class="col-lg-4">
<h3>Category 2</h3>
<a href="#">Link 1</a>
<a href="#">Link 2</a>
<a href="#">Link 3</a>
</div>
</div>
</div>
</div>
</div>
</div>
<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js" integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q" crossorigin="anonymous"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js" integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl" crossorigin="anonymous"></script>

最佳答案

简单地修复在 dropup-content 上添加缺少样式的顶部

    .dropup-content {
top:50px;
display: none;
position: absolute;
background-color: #f9f9f9;
width: 100%;
left: 0;
bottom:100%;
box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
z-index: 9999999;
}

here is demo

关于html - 在悬停大型菜单上不显示,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54166860/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com