- 2,898
- Posts
- 21
- Years
- Seen Jul 27, 2024
This is probably a n00bish question but anyways; is their anyway to imbed php code in a .css file without having to rename the extension and leaving as a .css extension.
AddType application/x-httpd-php .css
There are a lot of uses for it~ For example, you can change elements depending on what browser a visitor is using.Dragonfree said:Why exactly would you want PHP code in a .css file?
Eww, browser detect. :xPaul said:There are a lot of uses for it~ For example, you can change elements depending on what browser a visitor is using.
Or let them change the CSS using certain coding.
<?
// Declare variables
$text = "515C89";
$link = "263059";
$background = "B7BDD6";
$border = "D3D7E6";
?>
<style type="text/css">
<!--
<? print "
a { color: #$link; text-decoration: none; }
a:link { color: #$link; text-decoration: none; }
a:visited { color: #$link; text-decoration: none; }
a:active { color: #$link; text-decoration: none; }
a:hover { color: #$link; text-decoration: none; }
table { color: #$text; font-family: Tahoma; font-size: 10pt; background-color: #$background; }
body { color: #$text; font-family: Tahoma; font-size: 10pt; background-color: #$background; }
textarea { border: 1pt solid #$link; color: #$text; font-family: Tahoma; font-size: 9pt; background-color: #$background; }
.big { color: #$text; font-family: Tahoma; font-size: 14pt; }
.strike { color: #$text; font-family: Tahoma; font-size: 10pt; text-decoration: line-through; }
.center { text-align: center; }
.left { text-align: left; }
"; ?>
-->
</style>