?
Solved

Problem with background images in CSS & Tomcat

Posted on 2005-04-11
11
Medium Priority
?
267 Views
Last Modified: 2013-11-24
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!!
0
Comment
Question by:_MW_
  • 6
  • 4
10 Comments
 
LVL 33

Expert Comment

by:sajuks
ID: 13759705
check the path to the css file. That seems to be the problem here.
0
 

Author Comment

by:_MW_
ID: 13759843
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
 

Author Comment

by:_MW_
ID: 13759863
I am really sure its because of Tomcat cause I tried another servlet, IIS, and it worked there.
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
LVL 33

Expert Comment

by:sajuks
ID: 13759894
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
 

Author Comment

by:_MW_
ID: 13759932
nope...don't work
0
 
LVL 33

Expert Comment

by:sajuks
ID: 13759952
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
 

Accepted Solution

by:
_MW_ earned 0 total points
ID: 13760008
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
 

Author Comment

by:_MW_
ID: 13760034
Do you mind if I claim my points back?
0
 
LVL 33

Expert Comment

by:sajuks
ID: 13760072
do i've an alternative ?? claim it back....
0
 

Author Comment

by:_MW_
ID: 13760101
thanks =)
0

Featured Post

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Computer science students often experience many of the same frustrations when going through their engineering courses. This article presents seven tips I found useful when completing a bachelors and masters degree in computing which I believe may he…
When you discover the power of the R programming language, you are going to wonder how you ever lived without it! Learn why the language merits a place in your programming arsenal.
An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …
Starting up a Project

840 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question