How to apply the Scroll bar in the Menu items

How to apply the Scroll bar in the Menu items
0

#1

Hi

I am doing the :Technical Documentation Page" assignment. I have created a Grid for the left navigation menu. How do i add a scroll bar to it. Using

overflow: scroll;

creates a scroll bar for the whole page.

I also want to insert the horizontal lines under each menu item. I tried:

border-bottom: 2px solid black;

but it didn’t work. Kindly help. Here’s my page:


#2

You have to apply position: fixed to your .menu class and set the top, bottom properties to 0 and apply overflow: scroll

You have navigation bar as you mentioned in the left side, but there are no links in those, you have only span elements


#3

I will link them later. And how do u put the lines above each element?


#4

Just add this, it works and i removed the padding from .menu-items to make it fill the width


#5

When i apply the:

position: fixed;

in the .menu class it breaks the design of the container.
It’s not necessary that I use overflow: scroll, I can also use overflow-y: auto;
But for that I have to give a fixed height to the menu.


#6

Only with position: fixed, it won’t be good, you have to adjust it with top and bottom to 0


#7

I did that but it was breaking the dimensions of the container.
I modified the code a bit. I think it looks good now. Can you check?


#8

Also I want border-bottom along the grid lines. Not the span items because I don’t want to remove the padding.


#9

be aware that <span> tags are inline tags not block tags.


#10

Yes, i see the problem there, because you did not contain any elements inside your container and also you made the .menu to be fixed, therefore, the height of the container becomes null, if you set the height as 100vh you will regain the shape


#11

You can make the .container as position: relative and give .menu as position: absolute, hence the navbar stays inside the .container


#12

If you need border-bottom like that, then you must follow this type,

 <ul>
     <li><a>Link</a></li>
     <li><a>Link</a></li>
  </ul>

Therefore, you can apply the padding to the <a> tag and give the border-bottom to the <li> tags


#13

I have made some changes in my design. How do you think about it now?