Skip to content

Background stops when scrolling down #123404

Discussion options

You must be logged in to vote

Hi @LuComic

If the text inside your side panel is longer than the height of the side panel itself, it will overflow and continue scrolling while the background remains fixed.

To solve this issue, you can make the background of the side panel extend along with the content.

here we go:

.side-panel {
background-color: #151426;
transition: width 0.5s ease;
padding: 20px;
overflow-y: auto; /* Add overflow-y property to enable scrolling */
}

.side-panel-expanded {
width: 45%; /* Expanded width */
flex-shrink: 0;
padding: 20px;
}

/* Adjust the background color to fill the entire height of the side panel */
.side-panel-content {
background-color: #151426;
}

Also, in your HTML structure, wrap the …

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@LuComic
Comment options

@ebndev
Comment options

@sajadh76
Comment options

Answer selected by LuComic
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Programming Help Programming languages, open source, and software development.
3 participants