问题出在导航栏中的下拉菜单中。在全页模式下运行此导航栏时,您可以看到整个导航栏和部分Dropdown。如果单击此按钮,则下拉菜单将无法正确显示。您只能看到一个小的白色部分,仅此而已。我的问题是如何查看整个下拉菜单。
.demo{
background-color:blue;
height: 10000px;
}
.logo {
line-height: 60px;
position: fixed;
float: left;
margin: 16px 46px;
color: #fff;
font-weight: bold;
font-size: 20px;
letter-spacing: 2px;
}
.logo img{
height:60px;
}
nav {
position: fixed;
width: 100%;
line-height: 60px;
z-index: 5000;
text-decoration: none;
}
nav .menuul {
line-height: 60px;
list-style: none;
background: rgba(0, 0, 0, 0);
overflow: hidden;
color: #fff;
padding: 0;
text-align: right;
margin: 0;
padding-right: 40px;
transition: 1s;
}
nav.black .menuul {
background: rgb(32, 32, 32);
}
nav .menuul li {
display: inline-block;
padding: 16px 40px;;
}
nav .menuul li a {
text-decoration: none;
color: #fff;
font-size: 16px;
}
@media(min-width:1025px){
nav .menuul li a:hover { COLOR: white; TEXT-DECORATION: none; font-weight: bold; transition: width .3s ease-in-out;}
nav .menuul li a:after{
content: "";
position: absolute;
right:0;
top: 100%;
width: 0px;
height: 2px;
background-color: #FD3C3D;
transition: width .3s ease-in-out;}
nav .menuul li a:hover:after {width: 40%;}
}
.menu-icon {
line-height: 60px;
width: 100%;
background: rgb(32, 32, 32);
text-align: right;
box-sizing: border-box;
padding: 10px 24px 0px 24px;
cursor: pointer;
color: #fff;
display: none;
}
@media(max-width: 1025px) {
.logo {
position: fixed;
top: 0;
margin-top: 5px;
margin-left: 10px;
}
.logo img{
height:40px;
}
nav .menuul {
max-height: 0px;
background: rgb(32, 32, 32);
}
nav.black .menuul {
background: rgb(32, 32, 32);
}
.showing {
max-height: 34em;
}
nav .menuul li {
box-sizing: border-box;
width: 100%;
padding: 0px 24px 0px 24px;
text-align: left;
}
.menu-icon {
display: block;
}
nav .menuul li a:hover { COLOR: white; text-decoration: none;}
}
.usluge:hover .usluge-cont {
display: block;
}
.dropdown-menu{
z-index: 10000000 !important;
}
<!DOCTYPE html>
<html lang="en">
<head>
<title>Bootstrap Example</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.0/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js"></script>
</head>
<body>
<div class="demo">
<nav>
<div class="menu-icon">
<i class="fa fa-bars fa-2x"></i>
</div>
<div class="logo">
<img src="img/logo.png" alt="LOGO">
</div>
<div class="menu">
<ul class="menuul">
<li><a href="">Home</a></li>
<li><a href="">Menu#2</a></li>
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
Dropdown
</a>
<div class="dropdown-menu" aria-labelledby="navbarDropdown">
<a class="dropdown-item" href="#">Action</a>
<a class="dropdown-item" href="#">Another action</a>
<div class="dropdown-divider"></div>
<a class="dropdown-item" href="#">Something else here</a>
</div>
</li>
<li><a href="">Menu#3</a></li>
<li><a href="">Menu#4</a></li>
</ul>
</div>
</nav>
</div>
</body>
</html>
答案 0 :(得分:2)
您必须从“导航.menuul”中删除“ overflow”属性。 这是工作代码:
TouchPoint:
load_image:load_image
size_hint: 1,.78
pos_hint: {"top": .75, "left":1}
id: load_image
source: 'test_pics/image.png'
.demo{
background-color:blue;
height: 10000px;
}
.logo {
line-height: 60px;
position: fixed;
float: left;
margin: 16px 46px;
color: #fff;
font-weight: bold;
font-size: 20px;
letter-spacing: 2px;
}
.logo img{
height:60px;
}
nav {
position: fixed;
width: 100%;
line-height: 60px;
z-index: 5000;
text-decoration: none;
}
nav .menuul {
line-height: 60px;
list-style: none;
background: rgba(0, 0, 0, 0);
color: #fff;
padding: 0;
text-align: right;
margin: 0;
padding-right: 40px;
transition: 1s;
}
nav.black .menuul {
background: rgb(32, 32, 32);
}
nav .menuul li {
display: inline-block;
padding: 16px 40px;;
}
nav .menuul li a {
text-decoration: none;
color: #fff;
font-size: 16px;
}
@media(min-width:1025px){
nav .menuul li a:hover { COLOR: white; TEXT-DECORATION: none; font-weight: bold; transition: width .3s ease-in-out;}
nav .menuul li a:after{
content: "";
position: absolute;
right:0;
top: 100%;
width: 0px;
height: 2px;
background-color: #FD3C3D;
transition: width .3s ease-in-out;}
nav .menuul li a:hover:after {width: 40%;}
}
.menu-icon {
line-height: 60px;
width: 100%;
background: rgb(32, 32, 32);
text-align: right;
box-sizing: border-box;
padding: 10px 24px 0px 24px;
cursor: pointer;
color: #fff;
display: none;
}
@media(max-width: 1025px) {
.logo {
position: fixed;
top: 0;
margin-top: 5px;
margin-left: 10px;
}
.logo img{
height:40px;
}
nav .menuul {
max-height: 0px;
background: rgb(32, 32, 32);
}
nav.black .menuul {
background: rgb(32, 32, 32);
}
.showing {
max-height: 34em;
}
nav .menuul li {
box-sizing: border-box;
width: 100%;
padding: 0px 24px 0px 24px;
text-align: left;
}
.menu-icon {
display: block;
}
nav .menuul li a:hover { COLOR: white; text-decoration: none;}
}
.usluge:hover .usluge-cont {
display: block;
}
.dropdown-menu{
z-index: 10000000 !important;
}