struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Haroon Rafique <haroon.rafi...@utoronto.ca>
Subject Re: CSS background images, struts2
Date Tue, 04 Aug 2009 16:51:35 GMT
On Today at 9:38am, AL=>Andy Law <andy.law@roslin.ed.ac.uk> wrote:

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

Andy,

If your file structure is somewhat like:

styles/base.css
images/image.gif

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.

Later,
--
Haroon Rafique
<haroon.rafique@utoronto.ca>


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Mime
View raw message