[Solar-talk] CSS with image urls

Antti Holvikari anttih at gmail.com
Sun Dec 24 10:19:59 PST 2006


On 12/24/06, Rodrigo Moraes <rodrigo.moraes at gmail.com> wrote:
> On 12/24/06, Andreas Ravnestad wrote:
> > I usually just use relative url's like this: url('/path/to/style.css'). If
> > you need absolute urls, you could inline your css in a template and get the
> > absolute url from config, possibly. What hacks have you tried?
>
> Yes, this is the answer, except that the example is not good if the
> location of the CSS file is configurable. For common layout images,
> make sure that the images directory is always in the same location
> *relatively* to the CSS directory, and them use something like:
> url(../images/image.gif). For inline rules, parse them inside a
> template, as Andreas said.

You know what, you're right :-). Now that I think of it, the image
dirs *should* always be relative to the style dirs. So the
"../"-thingy works like a charm. Even better, use it like this:
"../../Vendor/images/..". This way you make it vendor-aware. Any
thoughts?

-- 
Antti Holvikari <http://phphalo.com>


More information about the solar-talk mailing list