Problem with background images in CSS & Tomcat

Hi,

I have problems displaying background images using CSS through the tomcat server.

I basically have a html file which links to a css file which has the background style. An example of one of the styles is

.centeractivetab
{
    background-image : url(../images/Tabs/centeractivetab.png);
    background-repeat : repeat;
    text-align:left;
    border-bottom:none;
    font-family : verdana,arial,sans-serif ;
    font-size:.8em;
    text-decoration: none;
    cursor: default;
}

The background image appears when I load the html file directly through IE. However, when I load it through the tomcat server, the background image is not there.

I am currently using Tomcat 5.0.

Any idea why is this happening?


Thanks!!
_MW_Asked:
Who is Participating?
 
_MW_Connect With a Mentor Author Commented:
I have actually solved the problem... it was a case sensitive issue.. cause I edited the image and Paint saved it as .PNG and in the css its .png.


Thanks for your time anyway....and sorry for being such a noob =(
0
 
sajuksCommented:
check the path to the css file. That seems to be the problem here.
0
 
_MW_Author Commented:
I am very sure the path to the css file is correct as I can change the attributes... ie if I change the cursor attribute from

cursor: default;

TO

cursor: pointer;

the changes are reflected.
0
Cloud Class® Course: Certified Penetration Testing

This CPTE Certified Penetration Testing Engineer course covers everything you need to know about becoming a Certified Penetration Testing Engineer. Career Path: Professional roles include Ethical Hackers, Security Consultants, System Administrators, and Chief Security Officers.

 
_MW_Author Commented:
I am really sure its because of Tomcat cause I tried another servlet, IIS, and it worked there.
0
 
sajuksCommented:
if you use an extension other then png are you able to view that image file ?
might be that tomcat is not configured to read png extensions ?try with either bmp or gif or jpeg
0
 
_MW_Author Commented:
nope...don't work
0
 
sajuksCommented:
can u check the path
background-image : url(../images/Tabs/centeractivetab.png);
i still feel this might be the cause of ur problems. Try placing the centeractivetab.png in the same directory as your script and see if it picks it up. My reasoning being that when the page loads the css file being in another directory and the page being in another directory the path to the centeractivetab.png is bein lost. not sure but if youy could check..

0
 
_MW_Author Commented:
Do you mind if I claim my points back?
0
 
sajuksCommented:
do i've an alternative ?? claim it back....
0
 
_MW_Author Commented:
thanks =)
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.