I made my CSS files out of JSPs, like so:

<%@ page contentType="text/css"%>
<%@ taglib uri="http://java.sun.com/jstl/core"; prefix="c" %>

body {
  background-color: #ECEDF1;
  font-family: 'Lucida Grande',Geneva,Verdana,Arial,sans-serif;
  background-image: url(<c:url 
value="/images/background/header_background.png"/>);
  margin-top: 0px;
  padding: 0;
}

And then called them like this:

<link rel="stylesheet" href="<html:rewrite page="/css/style.css.jsp"/>" 
type="text/css">

Who cares if it's ugly or whatever; I don't have broken images in my apps 
anymore.  :)


Andy










----- Original Message ----
From: Andy Law <andy....@roslin.ed.ac.uk>
To: user@struts.apache.org
Sent: Tuesday, August 4, 2009 5:00:12 PM
Subject: Re: CSS background images, struts2




Wes Wannemacher wrote:
> 
> One thing I've done in the past is to treat CSS files as JSPs and use
> s:url tags or EL expressions (${contextRoot}/images/image.gif)...
> 
> 


Oooooh. That feels soooo dirty!!!

There has to be a cleaner way to do it.

Later,

Andy
-- 
View this message in context: 
http://www.nabble.com/CSS-background-images%2C-struts2-tp24811929p24816196.html
Sent from the Struts - User mailing list archive at Nabble.com.


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


      

Reply via email to