Home Forums WoodMart support forum Global custom css not always loading at first time

Global custom css not always loading at first time

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #580720

    Johnn91
    Participant

    Hello,

    I used custom CSS in the WoodMart theme to customize things like shadows or, for example, the margin-bottom of the header. However, it seems custom CSS does not have priority when the site is loading for the first time.

    If you visit the website, at first it seems fine, but if you go to the “product” page or start navigating it, the custom CSS is not loaded at all until you press F5 to refresh the website.

    Example of CSS in “Global Custom CSS”

    /* header */
    
    #menu-main-navigation {
    	margin-top: 10px;
    }
    
    .whb-header {
        margin-bottom: 0px;
    }

    The first time I visit the website, the header seems fine. Then, if I navigate or just go back and navigate again, the header, for example, has a 40px margin-bottom, even though I set it to be 0px in the global custom CSS. However, if I press F5, it returns to the way I want, “reading” the custom CSS as it should.

    What could be causing this problem? This issue persists even if you use incognito mode in the browser and clear the browser cache. Could it be related to theme or basic theme-included plugin settings? The website is still under construction, so there are no more plugins than those needed during the installation process of the theme (Kids).

    Thank you in advance.

    • This topic was modified 10 months, 2 weeks ago by Johnn91.
    #580863

    Luke Nielsen
    Keymaster

    Hello,

    You need to make selectors heavier, try to use the below code and let me know if that works for you.

    body .whb-header {
        margin-bottom: 0px;
    }

    Kind Regards

    #580968

    Johnn91
    Participant

    Yes, just like this, adding ‘body’ seems to make it work.

    Thank you.

    #580971

    Luke Nielsen
    Keymaster

    Hello,

    You are welcome! In case you need any additional help, I’d be more than happy to assist you.

    Have a good day!

    Kind Regards

Viewing 4 posts - 1 through 4 (of 4 total)

The topic ‘Global custom css not always loading at first time’ is closed to new replies.