is there a way to position absolute a scrollbar?

screenshot for a reference, i've added a overflow to scroll to the main panel of dashboard i dont want the side bar to scroll. but i want the scroll bar to be at the right corner of the screen position absolute isn't working. is there a work around
No description
13 Replies
Jochem
Jochem9mo ago
you've probably got a margin on the right side of the main content div. Change it to a padding, that'll push the scrollbar to the right the scrollbar will always be on the extreme right of the element that's scrolling, so your only solution is to make the element end where you want the scrollbar to be (or to roll your own which is a lot of hard work and an accessibility nightmare you should never attempt)
Israr
IsrarOP9mo ago
what i am doing right now is i'vewraped the wholething into 1 div to maintain the max width is there a way to maintain a maxed with while using padding for this
Jochem
Jochem9mo ago
a wrapper div. have that one be the scrolling one and the content div inside be the one with the margin or padding (doesn't really matter then anymore)
clevermissfox
clevermissfox9mo ago
box-sizing : border-box
Israr
IsrarOP9mo ago
can you please elaborate?
Israr
IsrarOP9mo ago
what i did now is wrapped the whole thing into a container annd outer div is full width
No description
Israr
IsrarOP9mo ago
now the scrollbar is at the corer but the side bar is also scrolling how do i make it stick there? sticky isnt wornking
Jochem
Jochem9mo ago
you'll have to share your code at this point, preferably in something like codepen or another live version
Israr
IsrarOP9mo ago
made it work
No description
Israr
IsrarOP9mo ago
😮‍💨 finally
Skriti mož
Skriti mož9mo ago
what was the thing?
Israr
IsrarOP9mo ago
scrollbar
clevermissfox
clevermissfox9mo ago
Box-sizing: border box takes the border and padding to count within any sizing defined instead of adding it on as extra. You’ll see in many resets that it’s defined on the *, *::before, *::after selector So if you have a width of 200px, your 10px border and padding of 2em is included in that 200px
Want results from more Discord servers?
Add your server