My google site does not add CSS til after the elements

My main issue is that my CSS does not load with the elements. I'm placing my CSS/HTML insde the HTML boxes as a lot of styling is not allowed directly in the HTML. There are a bunch of other frustrating things with Google Sites but this is what I need help with right now.

I'll navigate/refresh my page and all of my elements will display without CSS. Then after a few seconds the CSS is applied and things look how I want.

How do I get the CSS to load correctly? I can't have my menus and object load looking all crazy.

Here is a random example of code that does this (anything I've put into these boxes does this)

<style type="text/css">
span
{
    float:left;
    width:0.7em;
    font-size:400%;
    font-family:algerian,courier;
    line-height:80%;
}
</style>
<p>
    <span>T</span>he first letter in ths paragraph is styled
    with CSS to be 400% larger than the rest of the text.
</p>

UPDATE: I've spoken with a Google Apps rep and they opened a ticket as the css not loading is a bug. No word on the time frame but they are working on it.

Answers


I have the same problem and a workaround can be

<style type="text/css">
.show-on-load {
    display: block !important;
}
span
{
    float:left;
    width:0.7em;
    font-size:400%;
    font-family:algerian,courier;
    line-height:80%;
}
</style>
<p class="show-on-load" style="display: none;">
    <span>T</span>he first letter in ths paragraph is styled
    with CSS to be 400% larger than the rest of the text.
</p>

This way the content doesn't display until the CSS is loaded. Unfortunately, I can't use this workaround myself because I have to support IE8 and style tags don't load at all there.

Edit: use opacity instead so IE8 is supported


Need Your Help

Int considered as bool, & operator

c++ operators boolean int

I've been struggling for a while with a part of my code and I finally found that the problem lies with a simple test that don't give me the result I expect.

Put a <a> hyperlink in a django message

django django-templates

I'm using django messages and i want to put an hyperlink in it.