I have a scrollable div and was trying to implement shadow on top of the div when scrolling the div.
I found this simple implementation on codepen : https://codepen.io/bennyzhao/pen/iGoBm
This example did work for me, but after I was playing around, I discovered something strange with the behavior of background-attachment: local
when direction
is set to rtl
.
I've created a very simple example on codepen to show the strange behavior : https://codepen.io/Ron537/pen/ZLaqoG
I've noticed that the problem exists in Google Chrome
but works fine with Microsoft Edge
.
Here is an image comparasion : Chrome vs Edge
As you can see, with Google Chrome
the background not occupies the entire div width, but leaves some blank space.
Is this a known bug? Is there a solution for this?