I am using Bootstrap's navbar with .shadow-sm
. I have two divs beneath it, one without background and the other one with a white background.
The shadow appears as expected in the div with no background specified, but it is being obscured by the white background in the other div.
<body>
<div id="app">
<nav class="navbar navbar-expand-md navbar-light bg-white shadow-sm">
<div class="container">
<a class="nav-brand" href="{{ url('/') }}">
Home
</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="{{ __('Toggle navigation') }}">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul class="navbar-nav mr-auto">
</ul>
<ul class="navbar-nav ml-auto">
<li class="nav-item pr-md-4">
<a class="nav-link" href="#">Platform</a>
</li>
<li class="nav-item pr-md-4">
<a class="nav-link" href="#">Settings</a>
</li>
<div class="navbar-text border-left d-sm-none d-md-block pl-md-3"></div>
</ul>
</div>
</div>
</nav>
<main class="pb-4">
<div class="container-fluid">
<div class="row">
<div class="col-md-3 left-panel pt-5 pr-4 d-none d-md-block text-right">
Left menu
</div>
<div class="col-12 col-md-9 pt-5 px-4 center-panel">
<div class="h1">
Dashboard
</div>
<div class="row">
<div class="col-12 col-md-6">
Welcome back!
</div>
</div>
</div>
</div>
</div>
</main>
</div>
</body>
html, body {
font-family: $font-family-sans-serif;
font-size: 1rem;
line-height: 1.8;
font-weight: normal;
color: $textBlack;
background: linear-gradient(180deg, #E9EDF3 0%, rgba(255, 255, 255, 0) 100%);
min-height: 100%;
margin: 0;
}
.left-panel {
min-height: 100vh;
}
.center-panel {
min-height: 100vh;
background-color: white;
}
.content-panel {
min-height: 100vh;
}
.right-panel {
min-height: 100vh;
background-color: white;
}
I'm having trouble with the shadows displaying correctly due to overlapping with a white background in one of the divs. I've experimented with padding and margins but haven't found a solution yet.
Since the two panels have different colors, I can't simply remove the backgrounds and rely on the body background alone. Any suggestions on how to address this issue would be greatly appreciated.