Hi All,
I was able to meet the requirements but i want to make my page better.
I got an issue with my navigation on the left. I got 14 links/buttons there but when the browser gets smaller for some reason the last link - “reference” cannot get scrolled. The scroll stops at Function declarations. If i add some empty links under “reference”, it can be seen again but i think it is not the most professional way.
Could you please help me find the solution for this one?
I link my nav codes here.
Thank you.
HTML
<nav id="navbar"> <div class="header"> <header class="navheader">JS Documentation</header> </div> <ul> <li><a href="#Introduction" class="nav-link">Introduction</a></li> <li><a href="#What_you_should_already_know" class="nav-link">What you should already know</a></li> <li><a href="#JavaScript_and_Java" class="nav-link">JavaScript and Java</a></li> <li><a href="#Hello_world" class="nav-link">Hello world</a></li> <li><a href="#Variables" class="nav-link">Variables</a></li> <li><a href="#Declaring_variables" class="nav-link">Declaring variables</a></li> <li><a href="#Variable_scope" class="nav-link">Variable scope</a></li> <li><a href="#Global_variables" class="nav-link">Global variables</a></li> <li><a href="#Constants" class="nav-link">Constants</a></li> <li><a href="#Data_types" class="nav-link">Data types</a></li> <li><a href="#if...else_statement" class="nav-link">if...else statement</a></li> <li><a href="#while_statement" class="nav-link">while statement</a></li> <li><a href="#Function_declarations" class="nav-link">Function declarations</a></li> <li><a href="#Reference" class="nav-link">Reference</a></li> </ul> </nav>
CSS
#navbar {
position: fixed;
width: 18.75rem;
height: 100vh;
margin: 0.5rem 0.5rem 0rem 0rem;
border-right: 2px solid darkgray
}
.navheader {
position: fixed;
font-weight: bold;
font-size: 1.5rem;
padding: 0.95rem;
z-index: 1;
background-color: white;
}
nav ul {
margin-top: 3.5rem;
width: 100%;
height: 100%;
overflow: scroll;
}
nav ul li {
list-style: none;
border-top: 0.06rem solid black;
padding: 0rem;
}
nav ul li a {
text-decoration: none;
color: rgb(77, 76, 76);
display: block;
padding: 0.95rem;
}
nav ul li:hover {
background: black;
}
nav ul li a:hover {
color: white
}