• Resolved jpbonin

    (@jpbonin)


    Hey,

    I noticed that the background color of my site (set in custom background) is briefly loading and then reverts to white. Anyone heard of something like that?

Viewing 5 replies - 1 through 5 (of 5 total)
  • Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    You could have two CSS styles applying the background colours.

    1. First style is in a stylesheet linked early in the webpage HTML structure, which loads your background colour.

    2. Second style is in another stylesheet linked later in the webpage HTML structure, which loads the other white colour and overwrites your style.

    Your browser will load the HTML page from top to bottom, which would explain this problem.

    Thread Starter jpbonin

    (@jpbonin)

    Thanks, that makes a lot of sense, but I have no idea where such a second stylesheet could come from. Here’s a link

    I don’t think it is your CSS, I think you have left a tag out of the end of your body tag…

    If you view the source of your site you see this:

    <body class="home page page-id-520 page-template page-template-page-accueil-php"<div id="fb-root"></div>

    Facebook’s javscript is replacing the <div id="fb-root"></div> with code containing an .fb-reset class, that will rest the background to white as the class is being appended to your body tag.

    To fix it, open your header.php, and make sure that you have actually closed your body tag properly, ie., it should be something like

    <body <?php body_class($theme); ?>>

    I think you left the second “>” out 🙂

    Thread Starter jpbonin

    (@jpbonin)

    Thank you so much Max. Very impressive. I could have searched for years without even noticing the absence if this tag. 🙂

    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    It is difficult to notice absence of tags, but W3C’s validator can pick these issues out.

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Background color disapearing after loading’ is closed to new replies.