What you call a "background" is actually two sub add-page elements of add-page and sub-page . You need to define a background element for these subelements.
The simplest solution would be to remove background on both. Then it inherits the background color grey that you have already set to QScrollBar :
QScrollBar::add-page:horizontal, QScrollBar::sub-page:horizontal { background: none; }

But if you wish, you can style each to your liking:
QScrollBar::sub-page:horizontal { background: red; } QScrollBar::add-page:horizontal { background: green; }

A source
Unfortunately, this decision is quite difficult to guess from the official documentation .
Cory klein
source share