- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我的导航栏位于我的侧边栏之上。我需要的是侧边栏“覆盖”导航栏,这样当侧边栏消失时,导航栏就会可见。
由于侧边栏会折叠,因此发生这种情况时需要出现导航栏。就目前的情况而言,侧边栏看起来像是被切掉了,最终在侧边栏中失去了一个空间
侧边栏/导航栏图像:
<nav class="navbar navbar-light fixed-top flex-md-nowrap p-0 shadow">
<a class="navbar-brand " href="#"> </a>
<img src="~/Content/img/Principal_h_cor_RGB.png" alt="Logo" style="width:150px;">
<ul class="navbar-nav px-3">
<li class="nav-item text-nowrap">
</li>
</ul>
</nav>
<nav id="sidebar" class="sidebar-wrapper">
<div class="sidebar-content">
<div class="sidebar-brand text-center">
<a href="#"></a>
<div id="close-sidebar">
<i class="fas fa-times"></i>
</div>
</div>
<div class="sidebar-header text-center">
<h6 style="text-align:center">
<img src="~/Content/img/boat_block2.png " alt="Logo" style="width:70px;" />
</h6>
<div class="user-info">
<span class="user-name">
<strong>@Html.Partial("_LoginPartial")</strong>
</span>
<!-- <span class="user-role">Administrator</span> -->
<span class="user-status">
<i class="fa fa-circle"></i>
<span>Online</span>
</span>
</div>
</div>
</div>
</div>
</div>
</nav>
<script>
.sidebar-wrapper {
width: 260px;
height: 100%;
max-height: 100%;
position: fixed;
top: 0;
left: -300px;
z-index: 999;
padding-top: 45px;
}
.sidebar-wrapper ul {
list-style-type: none;
padding: 0;
margin: 0;
}
.sidebar-wrapper a {
text-decoration: none;
}
最佳答案
只需将固定顶的Z-Index改为10
.fixed-top {
position: fixed;
top: 0;
right: 0;
left: 0;
z-index: 10;
}
关于html - 调整 SideBar 的位置,使其位于 NavBar 固定顶部的 "front",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53545944/
嗨,我最近使用 bootstrap 4 offcanvas 模板来构建我的网站 http://v4-alpha.getbootstrap.com/examples/offcanvas/# 现在我想让我
我有 2 个侧边栏 - 左侧和右侧。我希望左侧边栏始终可见,并编写此内容以在加载时打开它: $(document).on('pagebeforeshow', function(){ $("#l
我是一名优秀的程序员,十分优秀!