|
|
 |
RE: FN-FORUM: An easy one for you all (but not for me apparently!)
date posted 19th August 2003 19:26
Pam, quoting me:
> > It's dead useful if you're using scripting-language-of-choice to
> > generate other sorts of content. This is why things like:
> >
> > and even:
> >
>
> When and how would you used PHP to create css. I am afraid it is not a
> eureka moment for me. There was a discussion about two weeks ago on a
> similar line if I remember rightly which I couldn't follow.
'How' is easy - just set the Content-type header to "text/css" (not vital -
most browsers do the right thing), and just echo() CSS instead of HTML. So,
if say you want to allow people to change the body colour[1], you could do
something like this in 'stylesheet.php':
...and call the stylesheet like: to get blue body text, for example.
[1] OK, I couldn't come up with a reason why you'd ever want to dynamically
generate CSS. But it's dead useful for images and javascript, as was
mentioned in that previous thread.
Hope that helps...
- Nick Grimshaw
{ if you're not part of the solution, you're part of the precipitate. }
|
 |
|