css:
<style>
* {
list-style: none;
}
div {
width: 100%;
height: 1000px;
background: skyblue;
}
div:nth-child(2) {
background: lightpink;
}
div:nth-child(3) {
background: lightgreen;
}
div:nth-child(4) {
background: lightcoral;
}
ul {
position: fixed;
right: 30px;
width: 100px;
height: 100px;
margin: auto;
top: 0;
bottom: 0;
border: 1px solid blue;
padding: 0;
}
li {
width: 100%;
height: 25%;
line-height: 25px;
border-bottom: 1px solid blue;
box-sizing: border-box;
text-align: center;
}
li.active {
color: red;
}
<