View Single Post
Old 01-18-2013, 07:42 PM   PM User | #4
AndrewGSW
Senior Coder

 
Join Date: Apr 2011
Location: London, England
Posts: 2,120
Thanks: 15
Thanked 354 Times in 353 Posts
AndrewGSW will become famous soon enough
I understand it is not advisable but isn't it possible?

Code:
HTML file:
<link rel="stylesheet" type="text/css" href="a_style.css.php">

a_style.css.php file:
<?php
header("Content-type: text/css; charset=utf-8");
//your php + css code goes here
?>
We have to use PHP to append a query variable to the end of the href

PHP Code:
href="a_style.css.php?version=<?php echo $some_number ?>">
otherwise it will use the version in the browsers' cache.

But why bother? That's what classes, ids, etc., are for??
__________________
"I'm here to save your life. But if I'm going to do that, I'll need total uninanonynymity." Me Myself & Irene.
Validate your HTML and CSS

Last edited by AndrewGSW; 01-18-2013 at 07:45 PM..
AndrewGSW is offline   Reply With Quote