I have a sidebar with its position set to relative:
.home-left-sidebar,
.home-right-sidebar {
flex: 1;
color: rgb(66, 66, 66);
font-size: 17px;
position: relative !important;
}
It has a child that is set to fixed:
.left-sidebar {
position: fixed;
right: 0;
}
But for some reason the child isn't sticking to the parent div, instead it's sticking to the body.
<div className='home-left-sidebar '>
<LeftSidebar />
</div>
<div className='left-sidebar'>
<div className='left-sidebar-items'>
<ul>
<NavLink to='/home/popular'>
<li>Home</li>
</NavLink>
<NavLink to='/home/new'>
<li>Newest</li>
</NavLink>
<NavLink to='/home/likes'>
<li>My Likes</li>
</NavLink>
<NavLink to='/home/user/posts'>
<li>My Posts</li>
</NavLink>
</ul>
</div>
</div>
I don't know what I'm doing wrong here.