I am trying to implement a fixed sidebar for a table of contents (TOC) on a website (i.e. one that stays in the same place as the user scrolls up/down).
I'm doing so using the following code in HTML:
and in CSS:
My attempt was inspired by the following tutorial: https://www.w3schools.com/howto/howto_js_dropdown_sidenav.asp
While it looks fine on 100% zoom in Chrome, when I zoom in, the sidebar begins to occlude/hide/overlap some of the content adjacent to it, as illustrated below:

Anyone know how I can fix/resolve this such that the table of content behaves properly when zooming?

