Reputation:
I'd like to dynamically create my style sheet in PHP. So (without using .htaccess to tell the server to parse .css as PHP) my style sheet would end in .php
:
<link rel="stylesheet" type="text/css" href="styles.php">
Does that work? Is it within specification?
Upvotes: 0
Views: 96
Reputation: 2239
You should use the text/css
mime type to the output of that php file, so the browser can understand better. The extension is not a requirement.
<?php
header('Content-type: text/css');
?>
Upvotes: 3