Bootstrap顶部导航栏阻止我的内容laravel

您所在的位置:网站首页 bootstrap顶部菜单导航栏 Bootstrap顶部导航栏阻止我的内容laravel

Bootstrap顶部导航栏阻止我的内容laravel

2022-06-06 03:07| 来源: 网络整理| 查看: 265

I have a problem regarding about the navbar. Just now when I was able to do make the navbar stick to the top when scrolling, the top content was then blocking my view and I actually used this question to help me but it didn't work, is there another solution or am I just putting it at the wrong place? Here is the question that I used to help me, Twitter Bootstrap - top nav bar blocking top content of the page

I tried using this following of the codes but it doesn't help:

body { padding-top: 60px; } @media (max-width: 979px) { body { padding-top: 0px; } }

This is what happen enter image description here

So here is the codes:

app.blade.php(where my navbar is)

@yield('title') Toggle Navigation @include('layouts.testSidebar') @yield('title') ; @guest Login Register @else {{ Auth::user()->name }} Logout {{ csrf_field() }} @endguest @yield('content')

test.css (this is inside my sidebar code, I don't think the sidebar code is needed so I just put the css since it affect the navbar also)

body{ margin:0px; padding:0px; font-family:"Helvetica Neue", Helvetica, Arial; padding-top: 65px; } @media (max-width: 979px) { body { padding-top: 0px; } } #sidebar{ background:blue; width:200px; height:100%; display:block; position:fixed; left:-200px; top:0px; transition:left 0.3s linear; } #sidebar.visible{ left:0px; transition:left 0.3s linear; } ul{ margin:0px; padding:0px; } ul li{ list-style:none; } ul li a{ background:#0000FF; color:white; border-bottom:1px solid #111; display:block; width:180px; padding:10px; text-decoration: none; } #sidebar-btn{ display:inline-block; vertical-align: middle; width:20px; height:15px; cursor:pointer; margin:20px; position:absolute; top:0px; right:-60px; } #sidebar-btn span{ height:1px; background:white; margin-bottom:5px; display:block; } #sidebar-btn span:nth-child(2){ width:75%; } #sidebar-btn span:nth-child(3){ width:50%; } #navbar-toggle collapsed{ background:#0000FF; } .navbar { background:#0000FF; position: fixed; width: 100%; } nav.sidebar .navbar-nav .open .dropdown-menu>li>a:hover, nav.sidebar .navbar-nav .open .dropdown-menu>li>a:focus { color: white; background-color: transparent; } #test .dropdown-menu { position: absolute; top: 0; left: 180px; min-width: 180px; }


【本文地址】


今日新闻


推荐新闻


CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3