It’s likely that your theme is overriding these styles, and that you will need some more specific CSS code.
Can you tell me the code you tried to add so I can take a look?
Thread Starter
oiler
(@eulerarthur)
I tried this just for a test:
.element-is-not-sticky {
background: red;
}
.element-is-sticky {
background: blue;
}
and did not work.
It looks like your theme is using !important in its code, so you will need to override that using this code:
.element-is-not-sticky .main-header-bar{
background: red !important;
}
.element-is-sticky .main-header-bar{
background-color: blue !important;
}
Thread Starter
oiler
(@eulerarthur)
Thank you! But the header stays blue only, even in the top when it supposedly should be not sticky and so, red.
That is because your header is always sticky. Since it’s already at the top of the page when you load the page, it’s sticky by default, and so it will always be blue.