Hello and welcome to our community! Is this your first visit?
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New Coder
    Join Date
    Sep 2009
    Thanked 9 Times in 9 Posts

    CSS Prevent background reload

    Using the CSS3 code below to present a full screen background image, I have noticed that as I switch pages in the website, the Background is reloading. Basically the background goes white and then progressive loads the image. The code is in a external stylesheet linked to by all pages.

    Anybody know how this can be coded differently where the reload is not occurring?

    I assume it is because the "cover" attribute is recalculating the window/screen size each time, but I also thought that caching would prevent that. Anyways, any feedback would be great.

    body {
     background:url('../images/bg.jpg') no-repeat center center fixed;
    -webkit-background-size: cover;
     -moz-background-size: cover;
     -o-background-size: cover;
     background-size: cover;

  2. #2
    Regular Coder Custard7A's Avatar
    Join Date
    Jul 2010
    Thanked 33 Times in 33 Posts
    I'm not familiar with using cover, but I would have thought caching would keep the image in memory regardless. It's probably something silly, like your browser cache is full, or not actually on (I don't mean to be insulting ). Perhaps try it in several browsers, and see if still insists on reloading each time?


Posting Permissions

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