Use a relative path.

In my applications I store my CSS in:
src/main/webapp/assets/styles/
And my images in:
src/main/webapp/assets/images/

An example of using a relative path in my CSS file:
background-image: url('../images/logo.png');

The path is relative to the CSS file and NOT the page, so this should work
fine on all pages.

Hope this helps,
Daniel



deian wrote:
> 
> Hi Guys,
> 
> What can we do about using tapestry variables in the CSS files?
> 
> I have a css file in where I want to use an image as background. So I want
> to use something along the lines: 
> 
> mySite.css 
> 
> .mystyle {
>   background: url(${context:images/myImage.png});
> }
> 
> Any ideas?
> 
> Cheers,
> Deian
> 

-- 
View this message in context: 
http://www.nabble.com/background%3A-url%28%24%7Bcontext%3A-image%7D%29-in-CSS-file--tp25786987p25802983.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org

Reply via email to