Effects Box Error


#1

Good Afternoon
I need help with dimming a effects box when a sidebar comes out from the left. (Note that I will Post Images to make what I am saying clear) The problem is that when the side bar come out, the whole page except the box goes grey. (See Image One - the box has no info in it as the information is classified. The Sidebar also has been fitted with random keywords) Hence how can I make the box go grey like the rest of the page

This the HTML for the box:

<div class="box effect8">
    <h3>Example:</h3>
</div>   

This is the CSS for the Box:

.box h3{
	text-align:left;
	position:static;
	top:80px;
}
.box {
    border-left: 6px solid #0FA0FF;
    padding: 10px 50px;
	width:95%;
	height:300px;
	background:#FFF;
	margin:40px auto;
}

/* Effect 8*/

.effect8
{
    position:relative;
    box-shadow:0 1px 4px rgba(0, 0, 0, 0.3), 0 0 40px rgba(0, 0, 0, 0.1) inset;
}
.effect8:before, .effect8:after
{
	content:"";
    position:absolute; 
    z-index:-1;
    box-shadow:0 0 20px rgba(0,0,0,0.8);
    top:10px;
    bottom:10px;
    left:0;
    right:0;
    border-radius:100px / 10px;
} 
.effect8:after
{
    right:10px; 
    left:auto; 
    transform:skew(8deg) rotate(3deg);
}

Sidebar HTML
/* The Button that opens the sidebar is on the nav bar at the top of the page. Hence I am only giving the button part. If the whole navbar is needed, please inform me*/
          <li><div id="main">
  <span style="font-size:25px;cursor:pointer; float: right; color: white;" onclick="openNav()">&#9776;</span>
</div>
          </li>
/*Content of the Sidebar*/

<div id="mySidenav" class="sidenav" >
  <a href="javascript:void(0)" class="closebtn" onclick="closeNav()" style="color: #fff;">&times;</a>
    <br><br>
<h3 style="color: white; padding-left: 20px;"><ins>Lessons List</ins></h3>
  <a href="#">About</a>
  <a href="#">Services</a>
  <a href="#">Clients</a>
  <a href="#">Contact</a>
</div>

CSS for the sidebar:

    
.sidenav {
    
    height: 100%;
    width: 0;
    position: fixed;
    z-index: 1;
    top: 0;
    left: 0;
    background-color: #000000;
    overflow-x: hidden;
    transition: 0.5s;
    padding-top: 60px;
}

.sidenav a {
    padding: 8px 8px 8px 32px;
    text-decoration: none;
    font-size: 20px;
    color: #fff;
    display: block;
    transition: 0.3s
}

.sidenav a:hover, .offcanvas a:focus{
    color: #818181;
}

.sidenav .closebtn {
    padding-top: 50px;
    position: absolute;
    top: 0;
    right: 25px;
    font-size: 36px;
    margin-left: 50px;
}

#main {
    transition: margin-left .5s;
    padding: 8px;
}

@media screen and (max-height: 450px) {
  .sidenav {padding-top: 15px;}
  .sidenav a {font-size: 18px;}
}   

JavaScript for the Sidebar:

<script>
function openNav() {
    document.getElementById("mySidenav").style.width = "250px";
    document.getElementById("main").style.marginLeft = "0";
    document.body.style.backgroundColor = "rgba(0,0,0,0.4)";
}

function closeNav() {
    document.getElementById("mySidenav").style.width = "0";
    document.getElementById("main").style.marginLeft= "0";
    document.body.style.backgroundColor = "white";
}
</script>

If more info is required please don't hesitate to ask.
Thank You for your time
Regards
Satanshu


#2

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.