Ask Your Question
1

My fixed div overlaps the browser's scrollbar.

asked 2022-07-10 11:00:00 +0000

huitzilopochtli gravatar image

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
2

answered 2021-08-04 18:00:00 +0000

qstack gravatar image

To fix this issue, you can apply a padding-right property to the parent element of the fixed div that is equal to the width of the scrollbar.

For example, if your scrollbar width is 15px, you can add the following CSS to the parent element:

.parent-element {
  padding-right: 15px;
}

This will create some space on the right side of the parent element where the scrollbar will be placed, allowing your fixed div to stay within the browser's window.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss

Add Answer


Question Tools

Stats

Asked: 2022-07-10 11:00:00 +0000

Seen: 12 times

Last updated: Aug 04 '21