SitePoint Sponsor

User Tag List

Results 1 to 8 of 8
  1. #1
    Design and Promotion Crimson77's Avatar
    Join Date
    Aug 2006
    Location
    Australia
    Posts
    331
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Is there a way to make the external css load before any of the content

    Hi Guys and Gals,

    Just wondering if anyone knows how to make the external css layout styling load before any of the content. That includes background images etc.

    I'm wanting the rounded corners to show up on a box before any of the content shows up within that box. The rounded corners are external css background images.

    Look forward to your feedback.

    Thanks

  2. #2
    Non-Member deathshadow's Avatar
    Join Date
    Jul 2006
    Location
    Dublin, NH
    Posts
    901
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Well, that's kind of a loaded question... There is a way, but it's generally frowned upon - a splash screen wrapper.

    If you direct your users to a splash screen on 'first load' to your site that loads the CSS and precaches all the images, when it redirects to the final page it's all in the cache, so loads quicker...

    Not a 100% solution, but about as close as you're gonna get.

  3. #3
    Design and Promotion Crimson77's Avatar
    Join Date
    Aug 2006
    Location
    Australia
    Posts
    331
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hmmmm, you're right it's not an ideal solution…but I'll certainly keep it in mind.

    Anyone else got any other ideas on the situation?

  4. #4
    SitePoint Wizard bronze trophy Tyssen's Avatar
    Join Date
    Oct 2005
    Location
    Brisbane, QLD
    Posts
    4,067
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Not that I'd recommend doing it this way but you could set the CSS of the element holding your main content to display: none and then write a script that detects when the page is fully loaded before then resetting the display of the element to block.

  5. #5
    The CSS Clinic is open silver trophybronze trophy
    Paul O'B's Avatar
    Join Date
    Jan 2003
    Location
    Hampshire UK
    Posts
    40,556
    Mentioned
    183 Post(s)
    Tagged
    6 Thread(s)
    Why bother

    If I see nothing on a page even for a couple of seconds then I'm off if I see an icon that says page loading then I'm off somewhere else even quicker.

    As for splash screens then just don't go there

    Users these days know that pages load sequentially and I find if comforting to see something load straight away rather than when old fashioned tables are used and things have to wait until the table has loaded (even though you can add table-layout:fixed to stop this process).

    The benefit of css is that it doesn't wait for the images to be loaded and gives the user the important content first. I don't want to see a round corner first Id rather see the answer to my search/question and then I can decide to wait for the pretty background or not.

    You seem to be wanting the opposite of what the user wants and that is content first.

  6. #6
    Non-Member deathshadow's Avatar
    Join Date
    Jul 2006
    Location
    Dublin, NH
    Posts
    901
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Paul O'B
    You seem to be wanting the opposite of what the user wants and that is content first.
    I dunno, I'm getting a touch sick of seeing sites with loads and loads of content look like they finished loading, then a few seconds later (usually by the time I'm ready to start clicking on links or halfway through the first paragraph) everything jumps all over creation... It would be kind of nice to have the option to grab the CSS first BEFORE even attempting to render the html.

  7. #7
    The CSS Clinic is open silver trophybronze trophy
    Paul O'B's Avatar
    Join Date
    Jan 2003
    Location
    Hampshire UK
    Posts
    40,556
    Mentioned
    183 Post(s)
    Tagged
    6 Thread(s)
    It would be kind of nice to have the option to grab the CSS first BEFORE even attempting to render the html.
    Well I suppose there are arguments for both ways when you look at it like that

    However that behaviour is usually caused by images in the html not having their dimension set and then the browsers re-adjusting afterwards.

    I guess there is just no pleasing everyone

  8. #8
    Non-Member deathshadow's Avatar
    Join Date
    Jul 2006
    Location
    Dublin, NH
    Posts
    901
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Paul O'B
    However that behaviour is usually caused by images in the html not having their dimension set and then the browsers re-adjusting afterwards.
    Or a overburdened server hanging on the CSS request while acknowledging other ones first - a really common problem with IIS based setups, though it can happen on a linux box as well if somethings wrong with your filesystem...

    Of course, that it takes a filesystem corruption or hardware failure to get linux to do that, while all it takes on a windows server is excessive traffic...

    How's the old saying go? *nix is for servers, windows is for desktops, and never shall the 'twain meet?

    No wait, that's right. It's *nix is for servers, windows is for desktops, the internet is for P0RN, and I like corm.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •