Im looking to have the side navigation floated to the left as I scroll down the page. I tried using the sticky property, but it didn't work out. Here's a snippet of the code:
.sticky-class {
position: sticky;
top: 30px;
}
This is how my HTML looks like:
<div class="side-nav" fxFlex="80" fxLayout="row" fxLayoutGap="1px">
<div fxFlex="15">
<div class="sticky-class">
<app-sidenav></app-sidenav>
</div>
</div>
<div>
The app-sidenav
component uses angular material for displaying content. How can I make it float as I scroll down?
Any suggestions on how to achieve this would be greatly appreciated.