Answer the question
In order to leave comments, you need to log in
Why do styles disappear in Google chrome when scrolling inside a position: fixed element?
Sample code here
There is a position: fixed container, it has a scrollbar, there are elements inside it and they can be scrolled.
One of these elements has class="selected" written on it. This class sets the background. If you scroll down and then back to the selected class="selected" element, the background disappears.
WTF? How to overcome it?
Answer the question
In order to leave comments, you need to log in
You need to set the child elements to position: relative; then everything will be fine
nothing is lost. Look through the console. Most likely there is some script that removes the selected class
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question