We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 26482
    • 138 Posts
    Can somebody please look at this with a fresh pair of eyes?

    Issue:
    On a new site I’m using the CSS sprites technique to build the main menu. The background image for this menu is attached to the li element via a css rule (see css file below).
    Now, if I open up the site for the first time in FF (2.0.0.16), the background image is rendered last and, maybe as a consequence, the main text is shifted upwards. When the image finally appears, it is located through the text.
    However, if I press F5, the page is loaded correctly. Please note that in IE6 and Safari the page is rendered as expected.

    This is what I see in FF:

    Image of FF rendering


    I’ve run out of ideas why this happens (so consistently). Every first time I load the site this happens, but never afterwards. I can simulate this by clearing the cache.

    Thanks for listening.
    sderuiter




    html
    <div id="menu">
    
            <ul id="poppenmenu">
        <li id="menu1"><a href="/speelzaal/"></a></li>
        <li id="menu2"><a href="/login/"></a></li>
        <li id="menu3"><a href="/fotos/"></a></li>
        <li id="menu4"><a href="/contact/"></a></li>
      </ul>
            </div>
        
    [/html]

    CSS for menu
    #poppenmenu {
    
        width: 300px; height: 110px;
    
        background: url(/assets/images/4-poppen-resize.gif);
    
        margin: 10px auto; padding: 0;
    
        position: relative;}
    
    #poppenmenu li {
    
        margin: 0; padding: 0; list-style: none;
    
        position: absolute; top: 0;
    
        height : 100%; /*sdr*/
    
        
    
        }
    
    #poppenmenu li, #poppenmenu a {
    
        height: 110px; display: block;}  
    
      
    
    #menu1 {left: 0; width: 75px;}
    
    #menu2 {left: 75px; width: 75px;}
    
    #menu3 {left: 150px; width: 75px;}
    
    #menu4 {left: 225px; width: 75px;}  
    
    
    
    
    
      #menu1 a:hover {
    
        background: transparent url(/assets/images/4-poppen-resize.gif)
    
        0 -110px no-repeat;}
    
      #menu2 a:hover {
    
        background: transparent url(/assets/images/4-poppen-resize.gif)
    
        -75px -110px no-repeat;}
    
      #menu3 a:hover {
    
        background: transparent url(/assets/images/4-poppen-resize.gif)
    
        -150px -110px no-repeat;}
    
      #menu4 a:hover {
    
        background: transparent url(/assets/images/4-poppen-resize.gif)
    
        -225px -110px no-repeat;}
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      Loads fine in FF 3/Mac. Maybe a FF 2 rendering bug?
        Studying MODX in the desert - http://sottwell.com
        Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
        Join the Slack Community - http://modx.org
        • 26482
        • 138 Posts
        Thanks for the report. FF2 will be here for quite some time >:( , I’m afraid.
        Any hints on how to circumvent this?

        Thanks.
          • 28042 ☆ A M B ☆
          • 24,524 Posts
          And if you don’t use the image, what happens? It’s all in the CSS, so give it the trial-and-error treatment.

          You also might want to try validating it, both for HTML and CSS

          http://validator.w3.org/
            Studying MODX in the desert - http://sottwell.com
            Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
            Join the Slack Community - http://modx.org
            • 3749
            • 24,544 Posts
            Quote from: sderuiter at Jul 23, 2008, 04:50 AM

            Thanks for the report. FF2 will be here for quite some time >:( , I’m afraid.
            Any hints on how to circumvent this?

            Thanks.
            W3C turned up this error (though I don’t think it’s your problem).

            The character encoding specified in the HTTP header (utf-8) is different from the value in the <meta> element (iso-8859-1). I will use the value from the HTTP header (utf-8) for this validation.

            Strangely, I see the error in FF but when I turn on Firebug, it looks as it should.
              Did I help you? Buy me a beer
              Get my Book: MODX:The Official Guide
              MODX info for everyone: http://bobsguides.com/modx.html
              My MODX Extras
              Bob's Guides is now hosted at A2 MODX Hosting
              • 27708 MODX Staff
              • 2,502 Posts
              My guess is the absolute positioning used on the li elements in the CSS file. I personally would have made the li’s display:inline or display: inline-block and give them size in px not % because IE renders % funny anyhow.

              Absolute positioning is supposed to take elements out of flow so it could be that the dimentsions of the ul collapse upon use of absolute on its child elements. This may well be a FF2 bug.

              BTW while FF2 will be here for a while it something like 85%+ of firefox users upgraded to 3 since it came out. Vs less than 60% for IE7. So FF2 will be more and more edge case. I’d guess there are way more IE6 users than FF2.
                Author of zero books. Formerly of many strange things. Pairs well with meats. Conversations are magical experiences. He's dangerous around code but a markup magician. Blog ✦ Twitter ✦ LinkedIn ✦ GitHub