css load background but shouldn't

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View

Maybe someone will be able to help me.
My website has subpages.
On main page I don't use for example class="myclass",
I use this class just on one of the subpage.

myclass load background image. I have problem because
even if I dont use class myclass on main page I don't
understand why is load background image from myclass.
This picture I dont see on main page but if I make test
like that:
http://test.watchscript.pl /

or I use firebug I can see that background image from
myclass is loaded on main page.


Re: css load background but shouldn't

Quoted text here. Click to load it

I'm not entirely sure that I follow you. The watchscript.pl link you
gave just too me to a page that wasn't in English, so I don't know
what's going on with it.

Can you copy your CSS code here, and point out exactly which part is
giving you the bug?

Re: css load background but shouldn't

Quoted text here. Click to load it

Ok guys, thx for answare!

About css sprites I have read a lot of before.
How can you see the layout my page is complex
and there are a lot of small images.

If you have experience with css sprite could you
tell me is it work really well and improved you site
For example I have 23 or 25 http requests just for
small layout images. Use the css sprite I can decrease
25 req. to 2 or 3.

At this moment my page use raw css na js. I'm going
to compress my js (maybe the main js-scripts I will drop
to one file) and css. I'm going to move references to js
from header to end of body.

I so js commpressors with base62 encode but I think so it's not
good idea because I save some file size but the time on
customer site will be incrise because decoding.

Which one mentioned ways above you recomend and which one not

Kind regards

Re: css load background but shouldn't

Quoted text here. Click to load it

I use Gzip compression on my server, which helped a lot. You can use
this site to see if your page is correctly compressed:


After doing that, most of the little compression techniques became

Sprites made the biggest impact, I think. My header alone had 12 small
images for formatting, and while that didn't seem like a lot, I would
regularly have several hundred users on the site at once. Each of
those images created a connection, so 200 users would lead to 2,400
attempted connections.

I used CSS sprites to cut that image down to 1, so now, 200 users is
only 200 attempted connections.

Re: css load background but shouldn't

Quoted text here. Click to load it


Are you sure? I have read on few websites that if you don't have
any references in currently html document to specific class than
background images shouldn't load.
On any others websites I have read something diffrent I mean
that all background images will load from css independent it's
any reference in currently document or it's not (this is what
you said).

The way cut css for small parts and use like internal for specific
subpage is good, but for example I use some classes on 60% subsites
ect. so it's not well way and make mess I have to repeat the same code
several time.

Kind Regards

Re: css load background but shouldn't

It's impossible to say for sure without seeing the code, and the link
you give doesn't seem to demonstrate the problem for me.

However, you need to be aware of the different meanings of the
different prefixes in CSS:

<no prefix>html    applies to the html element on any page which loads
the CSS file (the html element is effectively the entire page).

.html    refers to any element with the attribute class="html"

#html    refers to any element with the attribute id="html"

Etc.  It sounds as though you might have a prefix wrong.

Quoted text here. Click to load it
Please always reply to ng as the email in this post's
header does not exist.  Or use a contact address at:

Site Timeline