CSS Basic Question

Ye' old general discussion board. Basically, for everything that isn't covered elsewhere. Come here to shoot the breeze, shoot your mouth off, or whatever suits your fancy.
This forum is not for asking programming related questions.

Moderator: General Moderators

Post Reply
bloodl
Forum Commoner
Posts: 48
Joined: Thu Jun 21, 2007 12:33 am

CSS Basic Question

Post by bloodl »

Is it possible to have php echoing in style sheets?

I was going to have a standard CSS doc with a PHP include which grabbed my external colors, then echo the HEX values into the CSS color values. Can this work ? Maybe I am going about it all wrong?
User avatar
nor0101
Forum Commoner
Posts: 53
Joined: Thu Jan 15, 2009 12:06 pm
Location: Wisconsin

Re: CSS Basic Question

Post by nor0101 »

easily done:

Code: Select all

 
<style type="text/css" media="all">
    @import url("./style.php");
</style>
 
now you can use PHP in your stylesheet!
bloodl
Forum Commoner
Posts: 48
Joined: Thu Jun 21, 2007 12:33 am

Re: CSS Basic Question

Post by bloodl »

Thanks for your reply!!

So I understand correctly, style.php can have a mixture of php code and styles ?
User avatar
nor0101
Forum Commoner
Posts: 53
Joined: Thu Jan 15, 2009 12:06 pm
Location: Wisconsin

Re: CSS Basic Question

Post by nor0101 »

Yes, it must be a PHP script that when run outputs valid CSS though.
bloodl
Forum Commoner
Posts: 48
Joined: Thu Jun 21, 2007 12:33 am

Re: CSS Basic Question

Post by bloodl »

thanks heaps!
Post Reply