I created JANITOR which:
Inserts a navigation tree for modules, packages and types (interfaces, classes, enums, exceptions, errors, annotations) into the Javadoc pages of Java 11+.
The main elements involved are:
...
<div id="nav&mainContainer" style="display: flex;">
<div id="nav" style="width: 25em; height: 386px; border-right: 1px solid; overflow-y: scroll;">
<main role="main" style="flex: 1 1 0%;">
...
How can I achieve that the navigation (<div id="nav" ...>
) stays always at the same place left of the viewport if the page is scrolled so that visually only <main>
is scrolled?
UPDATE
Using:
<div id="nav" style="position:fixed; ...>
as proposed in an answer:
try using the css styling "fixed"
<div id="nav" style="position:fixed; width: 25em; height: 386px; border-right: 1px solid; overflow-y: scroll;">