Topic: CSS background (Page 1 of 1) Pages that link to <a href="https://ozoneasylum.com/backlink?for=25064" title="Pages that link to Topic: CSS background (Page 1 of 1)" rel="nofollow" >Topic: CSS background <span class="small">(Page 1 of 1)</span>\

 
crip
Bipolar (III) Inmate

From: iasi, romania
Insane since: Apr 2002

posted posted 02-20-2005 21:37

Hi...
Silly question..is there any way to preload a page background, added through css?
I mean it seems to load up a bit after the whole site has loaded. It's added to too many pages for me to go back and put it in the body tag.. So , just wondering what could be done...


Curiously yours, crip

Steve
Maniac (V) Inmate

From: Boston, MA, USA
Insane since: Apr 2000

posted posted 02-20-2005 22:32

Add it to the body tag in all the pages? No - you add it to the body selector in your style sheet! And I would think that once the browser has cached it for one page it would be instantaneous for every subsequent page. No?

DL-44
Maniac (V) Inmate

From: under the bed
Insane since: Feb 2000

posted posted 02-21-2005 00:29

On top of the general drawbacks of adding it to the body tag, it wouldn't make it load any faster that way anyway....

I agree with Steve, after the first page load, everything should be all set.

If not, or if you aren't happy with things loading the way they do initially, I think you'll have to find a javascript solution, loading all the images and data before rendering the page at all...

crip
Bipolar (III) Inmate

From: iasi, romania
Insane since: Apr 2002

posted posted 02-21-2005 02:06

Yes, i know adding to the body tag is silly. It is ALREADY added to the body selector in the css file. But it loads strangely when the first page is accessed.
I know about js preloads, i just have no idea how that would work with css-based page backgrounds. Will they work? Do i have to attache first the js file and then the css? Does it matter?


Curiously yours, crip

Steve
Maniac (V) Inmate

From: Boston, MA, USA
Insane since: Apr 2000

posted posted 02-21-2005 03:10

"But it loads strangely when the first page is accessed."

How?

crip
Bipolar (III) Inmate

From: iasi, romania
Insane since: Apr 2002

posted posted 02-21-2005 12:46

Sorry, just loads up the last thing, that's the strange part.


Curiously yours, crip

Blaise
Bipolar (III) Inmate

From: London
Insane since: Jun 2003

posted posted 02-21-2005 17:00

Have you turned off caching on your browser? Correct me if I'm wrong, but as I understand it, CSS is loaded into the browser and then cached, subsequent views of pages with said style sheet attached will forego any extra loading and use the cached style sheet instead.

Meaning that once the BG has been loaded in once, it should appear instantly on subsequent page views.

OOOH and it's snowing in London!! How exciting!



(Edited by Blaise on 02-21-2005 17:01)

crip
Bipolar (III) Inmate

From: iasi, romania
Insane since: Apr 2002

posted posted 02-21-2005 18:01

Well, I could turn off my browser's caching, what about the users' ?


Curiously yours, crip

Steve
Maniac (V) Inmate

From: Boston, MA, USA
Insane since: Apr 2000

posted posted 02-21-2005 19:09

No! You don't want the cache disabled! You WANT the browser to store the style sheet and the background image. The image will probably load noticably slower than the rest of the page content, but only the first time. After that, assuming cache is enabled, the background image should load essentially instantaneously for subsequent pages.

Rinswind 2th
Maniac (V) Inmate

From: Den Haag: The Royal Residence
Insane since: Jul 2000

posted posted 02-22-2005 01:25

link?

Cut down the background image. (by removing colors, changing size or a little more compression) That should speed it up a bit.

------------------------------
Support Justice for Pat Richard

Blaise
Bipolar (III) Inmate

From: London
Insane since: Jun 2003

posted posted 02-22-2005 11:33

Oh, I didn't mean you should turn off the caching, I was asking if you HAD turned off the caching!

[grumble]stupid monotonal web chat...[/grumble]

Skaarjj
Maniac (V) Mad Scientist

From: :morF
Insane since: May 2000

posted posted 02-22-2005 11:54

there's a trade-off to be made here... if your background repeats the less you have in the actual file the faster it will load, but the slower it will render and refresh as you scroll... finding the balance will take some testing and playing around.


Justice 4 Pat Richard



Post Reply
 
Your User Name:
Your Password:
Login Options:
 
Your Text:
Loading...
Options:


« BackwardsOnwards »

Show Forum Drop Down Menu