[pmwiki-users] Referring to images in a skin CSS file
Petko Yotov
5ko at 5ko.fr
Mon Mar 16 16:44:01 CDT 2009
On Monday 16 March 2009 21:08:07 Jo Vermeulen wrote:
> I was wondering what is the best way to refer to background images in the
> CSS style sheet for a custom skin? Is it possible to use PHP variables to
> get the current skin directory in the CSS file (just like how the CSS file
> is linked in the template)?
If the picture.jpg is in the same directory as the skin.css file, you refer to
it like this (for example) :
div.siteheader { background: url(picture.jpg) repeat-x; }
If you refer to the picture from the skin.tmpl template, you can use the
variable $SkinDirUrl :
div.siteheader { background: url($SkinDirUrl/picture.jpg) repeat-x; }
> Will this still work when rewrite rules are
> used (e.g. to rewrite example.com/pmwiki.php/?n=Group.Page ->
> example.com/Group/Page)?
Yes.
Thanks,
Petko
More information about the pmwiki-users
mailing list