Trying to create a webpage with a specific layout:
Everything looks good, but if the content on the right goes off the page and requires scrolling, the left menu bar ("second_navbar") doesn't stretch to the end of the page.
I've attempted changing the "position" to absolute and adding a "bottom" attribute set to 0, but it didn't work.
How can I make the left navbar stick to the top navbar and stretch to the bottom of the page after scrolling?
Thank you in advance for any advice!
UPDATE: I've added content on the left side, and the issue becomes noticeable when you minimize the window and scroll down.
* {
margin: 0;
padding: 0;
font-family: sans-serif;
}
html {
min-height: 100%;
}
body {
background-color: rgb(225, 225, 225);
}
#header {
position: relative;
background-color: white;
text-align: center;
border-color: rgb(93, 87, 87, 0.5);
color: rgb(93, 87, 87);
border-bottom-style: solid;
border-width: 1px;
}
p {
margin-top: 0;
padding: 5px;
font-size: 48px;
}
#navbar {
position: relative;
font-weight: bold;
color: rgb(93, 87, 87);
padding: 5px;
align-items: center;
background-color: white;
display: flex;
align-items: center;
justify-content: space-around;
}
#navbar li {
width: 160px;
font-size: 24px;
text-align: center;
text-decoration: none;
list-style: none;
}
#second__navbar {
width: 25%;
height: 100%;
position: fixed;
background-color: white;
text-decoration: none;
list-style: none;
}
#second__navbar li{
display: block;
font-size: 20px;
margin: 15% 0 0 15%;
}
<body>
<div id="header">
<p>My Name</p>
</div>
<div >
<ul id="navbar">
<li>TITLE</li>
<li>TITLE</li>
<li>TITLE</li>
<li>TITLE</li>
</ul>
</div>
<div>
<ul id="second__navbar">
<li>SUBTITLE</li>
<li>SUBTITLE</li>
<li>SUBTITLE</li>
<li>SUBTITLE</li>
</ul>
</div>
<div style="padding-left:50%; margin: 20% 20% 20% 20%">
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.
</div>
</body>