xxxxxxxxxx
.sidebar {
width: 200px;
height: 100%;
background-color: #333;
color: #fff;
position: fixed;
}
.sidebar ul {
list-style-type: none;
padding: 0;
margin: 0;
}
.sidebar li {
padding: 10px;
}
.sidebar li a {
color: #fff;
text-decoration: none;
}
.sidebar li a:hover {
background-color: #555;
}
.content {
margin-left: 200px; /* Same as the width of the sidebar */
padding: 20px;
}
xxxxxxxxxx
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body>
<div class="sidebar">
<ul>
<li><a href="#">Home</a></li>
<li><a href="#">About</a></li>
<li><a href="#">Services</a></li>
<li><a href="#">Contact</a></li>
</ul>
</div>
<div class="content">
<!-- Your main content goes here -->
</div>
</body>
</html>
xxxxxxxxxx
<div id="side-nav" style="width:100px(you can change this however you like);
height:100vh(if this doesn't work try 100%, anything that will get this to full height);
float:right/left; position:sticky;">
<ul>
<li></li>
</ul>
</div>