Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8339857
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T04:59:53+00:00 2026-06-09T04:59:53+00:00

I am placing a large, non-repeating background image on my website using the CSS

  • 0

I am placing a large, non-repeating background image on my website using the CSS background property. Since the image is so large, it takes a long time for some connections to render the image.

Here is my CSS:

#wrapper {
    background: url('large-image.jpg) no-repeat center center;
}

I have already done the following to optimize the image for the web:

  • Reduced it to the lowest possible resolution that does not compromise quality
  • Changed the image type from a PNG to a JPEG
  • Styled the page so that the content is readable even without the background image

My question: To further optimize the image loading time, would it make a difference if I put the background tag at the bottom of my style sheet? Or would the effect of this be negligible?

I tend to order my CSS by the hierarchy of my HTML, so the #wrapper styles are at the top of my style sheet. Does the order of properties in a style sheet make a noticeable impact on load time when the user has a slower connection?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T04:59:54+00:00Added an answer on June 9, 2026 at 4:59 am

    What could affect perceived loading time is initial #wrapper availability – i.e. if at the time of the initial load it is not part of the page and is added with JS, the background image will not begin loading – but I doubt this would be a common scenario.

    Background image loading does not affect domready handlers, however if you want to speed up background availability you could try the following:

    #wrapper {
        background: url(large-image.png) no-repeat center center,
                    url(small-image.png) no-repeat center center;
    }
    

    From mdn:

    With CSS3, you can apply multiple backgrounds to elements. These are
    layered atop one another with the first background you provide on top
    and the last background listed in the back. Only the last background
    can include a background color.

    What this does is effectively allows you to load a lower-res image as the bottom layer of the background, while the expensive hi-res image is still loading. Remember the good old times of lowsrc? That’s the behaviour we’re simulating. Note that both the low- and the hi-res image downloads begin simultaneously, so use this only if the large image is truly unbearably large.

    Also: you’re saying you’ve optimized the image; I still suggest you try Yahoo SmushIt, you’d be surprised how muich redundant data can be stripped from a PNG witout loss of quality (I currently have intermittent problems using their service, but it works after a few attempts, alternatively you could use OptiPNG but imo it would be too much effort to set it up and configure for a single image)

    Update:

    It has been suggested you wait for domready to fire and add your style using $("#wrapper").css(...);. What that does is add inline styling to an element, which would 1) interfere with selector specificity 2) only apply to this particular instance of #wrapper (bad if, say, it is part of ajax content coming from the server).

    You could alternatively add a new css rule at runtime:

    $('head').append('<style type="text/css">#wrapper {background: url(large-image.jpg) no-repeat center center;}</style>');
    

    This would be organically added to document stylesheets and apply to all future instances of #wrapper, as well as not interfere with selector specificity. You still end up with a brief flash of unstyled content (before the handler is fired and the style is applied) so I don’t advocate this approach.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using Fancybox to load some content with AJAX. Content: <div class="container"> <h2>An image</h2>
Placing an image inside a Span (here : HtmlGenericControl ) programmatically Want to have
I'm using Yii framework. On a couple of pages I want to add some
I am playing with Twitter API. Some numbers (like Twitter ID) is really large
i need to sort a large XML file and i've been reading that placing
Recently at the office we have been talking about placing large files into our
I'm playing with Ruby EventMachines for some time now and I think I'm understandings
I have a very large navigation bar on my website and I was given
When placing a conditional breakpoint in my code, this fails: Sophie Dee <> myString
When placing an icon on a page, it seems that it somehow overrode the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.