β Hi guys , i am struggling with the following CSS. i have a sidebar which is working fine,if i scroll down on my page it stays there and does not move which i want, now my NAV bar ontop wont stay put. when i scroll down it does not stay put.
any help appreciated
* {
margin:0px;
padding:0px;
font-family:sans-serif;
}
#sidebar ul {
list-style: none;
margin: 0;
padding: 0;
}
#sidebar {
position:fixed;
width: 200px;
height:100%;
background: #151719;
left: 0px;
transition: all 500ms linear;
}
#sidebar.active {
left:-200px;
}
#sidebar ul li {
list-style: none;
position: relative;
padding :15px;
width:170px;
border-top: 1px solid rgba(100,100,100,0.3);
}
#sidebar .toggle-btn {
position: absolute;
left:210px;
top:0px;
}
#sidebar .toggle-btn span {
position:relative;
display: block;
width: 30px;
height: 5px;
background: #151719;
margin: 5px 0px;
}
#sidebar ul ul {
transition: all 0.3s;
position: absolute;
background: #151719;
opacity: 0;
visibility: hidden;
height 100%;
left:100%;
top:-2%;
}
#sidebar ul li:hover >ul {
opacity: 1;
visibility: visible;
background-color: black;
}
#sidebar ul li a {
color:white;
padding:0px;
margin: 0 0;
text-decoration: none;
}
span {
margin-right:15px;
}
#sidebar ul li:hover {
background-color: grey;
}
.container {
width 80% margin :0 auto;
}
header {
background: #55d6aa;
}
header::after {
content:'';
display: table;
clear:both;
}
nav {
margin-left: 20%;
width:100%;
z-index: -1;
}
nav ul {
margin:0;
padding: 0;
list-style: none;
}
nav li {
display: inline-block;
margin: 20px;
padding-top:10px;
position: relative;
}
nav a {
color: #444;
text-decoration: none;
text-transform: uppercase;
font-size: 16px;
font-weight: 800;
}
nav a:hover {
color:white;
}
nav a::before {
content: '';
display: block;
height:5px;
width: 0%;
background-color: #444;
position: absolute;
top:0;
transition: all ease-in-out 400ms;
}
nav a:hover::before {
width: 100%;
}