* { position: relative; } .flexcontainer { display: flex; overflow-x: auto; scroll-behavior: smooth; position: relative; mask-image: linear-gradient(to right, black 80%, transparent); -webkit-mask-image: linear-gradient(to right, black 80%, transparent); }