• Hi, I already add these following CSS code to my website.

    #gv-header-nav {
       background: white;
    }
    .element-is-sticky {
       background: blue;
       }
    
    .element-is-not-sticky {
       background: red;
       }
    

    I want to make my header sticky. However, the header still doesn’t have any background color.

    The page I need help with: [log in to see the link]

Viewing 1 replies (of 1 total)
  • Hi, thanks for trying my plugin. ??

    I don’t see this code on your site, but if you want to override a style that’s assigned to an ID, you would need this:

    #gv-header-nav {
       background: white;
    }
    
    #gv-header-nav.element-is-sticky {
       background: blue;
    }
    
    #gv-header-nav.element-is-not-sticky {
       background: red;
    }

    Though technically, you won’t need three different colors. The element is either sticky or it’s not, so you will only need two colors. If you can remove the color from #gv-header-nav, then this should be enough:

    .element-is-sticky {
       background: blue;
    }
    
    .element-is-not-sticky {
       background: red;
    }

    Let me know if that helps.

    • This reply was modified 7 years, 1 month ago by Senff - a11n.
Viewing 1 replies (of 1 total)
  • The topic ‘No background’ is closed to new replies.