T
T
tripcollor2018-11-28 20:16:22
css
tripcollor, 2018-11-28 20:16:22

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

3 answer(s)
T
tripcollor, 2018-11-28
@tripcollor

You need to set the child elements to position: relative; then everything will be fine

J
Jupiter Max, 2018-11-28
@vardoLP

nothing is lost. Look through the console. Most likely there is some script that removes the selected class

F
frees2, 2018-11-28
@frees2

Perhaps I encountered something similar when opening the lists. Just put between scroll blocks
<div style="clear: both; "></div>

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question