struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Haroon Rafique <>
Subject Re: CSS background images, struts2
Date Tue, 04 Aug 2009 16:51:35 GMT
On Today at 9:38am, AL=>Andy Law <> wrote:

AL> [..snip..]
AL> th.myclass {
AL>     background-image: url('images/image.gif');
AL> }


If your file structure is somewhat like:


then you can simply change your background-image directive to say:
background-image: url('../images/image.gif');

or in other words, your image path will be relative to the path from where 
the .css file is located. So, no need to worry about context paths and/or 
nesting levels of action URLs.

Now, if your css is specified inline as part of the HTML, then you will 
need to make sure that your image path is relative to the path of the URL 
where the HTML was generated. That's a different scenario.

Hope this helps.

Haroon Rafique

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message