• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Rendering images with CSS in struts

 
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am trying to render an image on a JSP page through CSS in a struts application.

This is what I'm trying to do:

CSS
...
#topbar
{
width: 100%;
height: 50px;
background: #0066FF
url(/images/logo.gif) no-repeat center center;
}
...

JSP
...
<link href="CSS/styles.css" rel="stylesheet" type="text/css" />
...
<div id="topbar" />
...

The JSP reads the CSS file fine since all other formatting is acknowledged however the image for my top bar is not displayed. The background shows up fine. It seems like a context relative issue but I'm not sure how to resolve it. Any suggestions much appreciated.

Thanks.
 
Ranch Hand
Posts: 254
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You probably need to put your context path in the background-image url.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic