Pro-Tip: Tell your website to treat CSS files as if they’re PHP files to make life easier.
There are only two simple things you need to do to enable this!
- Add this to your .htaccess file:
AddHandler application/x-httpd-php .css
- Add this — inside <?php & ?> brackets — to the very beginning of your CSS file(s):
header(’Content-type: text/css’);
That’s really all there is to it.
Now you can use variables (and any other PHP) in your CSS files. Life is good.
- Bookmark this on del.icio.us.
- Search Google on this topic.
- Find more posts filed under Programming, Web Design.
{ 0 comments… add one now }
Leave a Comment