Are you a Google Analytics enthusiast?
More SEO Content
Css: Are All Images Loaded?
Posted 22 July 2007 - 09:23 AM
Eg. I have certain sections where I'm serving a jpg to IE6, but a png to browsers supporting png transparency. Does that mean that the modern browsers are downloading both the jpg and the png??
Posted 22 July 2007 - 11:45 AM
If the CSS effectively comments out stuff for browser for which a certain instruction doesn't apply, no the background images shouldn't be loaded. However by the same token if you have an image that is the default, but are then swapping out the image for a different one with a later css call for certain browsers, those users will cache both images.
Posted 22 July 2007 - 12:31 PM
Posted 22 July 2007 - 02:10 PM
If a css file containd say 10 divs all assigned a different background image, but only 5 are used on a particular page, do all 10 images load or just the 5 required for the page.
I think I know the answer, but would like confirmation.
Posted 22 July 2007 - 05:22 PM
My hunch is that it would only be downloaded once because the other four instances could be called from the browser cache. Of course this assumes the user has a typical setup that allows caching. Good question though. I just don't know for sure.
Michael: One thing you may want to consider if you can is to use Condition Comments to load totally different CSS files that are only triggered when the right browser reads them. This only works for IE browsers as far as I know, but is quite effective and also keeps your CSS files from becoming a huge jumble of mixed up code. Someone please tell me if other browsers will support it, though it's not usually necessary for anything other than IE. FF, and the rest seem to stick much closer to the specs, so a base css file seems to work well for them.
A search of any engine for the phrase Conditional Comments will bring up all sorts of information and likely open up new concepts in site coding for you. I can tell you I grudgingly started using them a couple of years ago and it's made my life a lot easier. Especially with the release of IE7 that caused many of the old IE6 css hacks to start failing for IE7 users.
Posted 23 July 2007 - 01:56 AM
Posted 23 July 2007 - 06:32 AM
If each of the 10 divs has a different background-image file set, my guess is that all 10 would be downloaded and cached, even if only 5 of the divs were actually called in a page. With the advantage being when the user went to another page that used a different div background image it would already be cached so wouldn't be downloaded again.
It shouldn't be too tough to test that. Create a page that has a css background image assigned to a div layer that's never called. Then check your cache to see if that image was downloaded after visiting the page. You'll probably want to test it in several browsers to see if there's a difference in the way they handle the situation, even though I have a feeling most if not all will download and cache the image.
Posted 23 July 2007 - 06:45 AM
Edit - Found it.
Edited by MichaelM, 23 July 2007 - 07:21 AM.
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users