html - 修复了在移动设备上滚动时导航栏被遮盖的问题
问题描述
因此,当我在查看我的网站时在任何移动设备上滚动时,具有重复图像的固定导航栏会被背景颜色覆盖。它不会每次都发生,但是如果您在滚动时按住它会发生。
我玩过 z-index 和 top 属性,但仍然没有骰子。
nav.repeat{
background-image: url(imgs/classiccardback.png);
background-repeat: repeat-x;
margin: 0;
opacity: 50%;
width: 100%;
margin-left: 0px;
top: 0;
z-index: 1;
}
html,body{
width: 100%;
height: 100%;
margin: 0;
margin-right: 2px;
padding: 0px;
background-color: #e9ecef;
overflow: auto;
-webkit-overflow-scrolling: touch;
}
/*I believe this is the only css that would be needed to recreate this other than bootstrap min css file*/
<nav style="z-index: 10;top: 0px; background-color: transparent;height:
59px;" class="repeat navbar navbar-expand-md navbar-light fixed-top">
<a style="text-decoration: none;padding: 0px;width: 300px;height:
61px;margin-left: -7px;" class="logoMargin rounded bg-dark" href="#">
<img src="imgs/heraldLogo2.png" width="300" height="60" class="d-
inline-block" alt="logo">
</a>
<button style="margin-top: -10px;" class="bg-white navbar-toggler"
type="button" data-toggle="collapse" data-
target="#navbarSupportedContent" aria-controls="navbarSupportedContent"
aria-expanded="false" aria-label="Toggle navigation">
<span class="bg-white navbar-toggler-icon"></span>
</button>
<div class="rounded collapse navbar-collapse w-25"
id="navbarSupportedContent">
<ul style="font-weight: bolder;" class="bigHeight smallHeight bg-
dark navbar-nav rounded ml-auto">
<li class="nav-item active">
<a style="margin-top: 5px;color: white;" class="nav-link"
href="#">Home <span class="sr-only"></span></a>
</li>
<li class="nav-item">
<a style="margin-top: 5px;color: white;" class="nav-link"
href="#">Link</a>
</li>
<li class="nav-item dropdown">
<a style="margin-top: 5px;color: white;" class="nav-link
dropdown-toggle" href="#" id="navbarDropdown" role="button" data-
toggle="dropdown" aria-haspopup="true" aria-expanded="false">
Dropdown
</a>
<div class="bg-dark dropdown-menu dropdown-menu-right" 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>
</ul>
</div>
</nav>
解决方案
推荐阅读
- python - 具有稀疏矩阵和向量的点积
- php - 如何使用 Doctrine 保存时间跨度/时间数据类型?
- java - 转为 png 的 HTML 文本模糊不清
- objective-c - dispatchBlock 和手动捕获的资源
- reactjs - 如何从列回调中获取对反应表的引用?
- python - Python psycopg2 Postgres :- 如何在 postgres 的 timestamptz 字段中插入没有时区的时间戳?
- xamarin - 应用关闭时未触发 OnMessageReceived(HMS Pushkit)
- python - 在 holoviews sankey 标签或悬停信息中显示附加值
- java - Spring Boot 测试过滤器
- reactjs - Native Base Picker 项目移动标题下的对象