I'm trying this example code:
http://sperling.com/examples/pcss/
but it's not working for me...
page 1 is style sheet - style.php with this code:
<?php
header("Content-type: text/css");
$color = "green"; // <--- define the variable
echo <<<CSS
/ --- start of css --- /
.title-text
{
color: $color; / <--- use the variable /
font-weight: bold;
font-size: 1.2em;
text-align: left;
}
/ --- end of css --- /
CSS;
?>
then page 2 is test php page called csstest.php
with this code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>test Document</title>
<link rel="stylesheet" href="style.php" media="screen">
</head>
<body >
<p class=".title-text">test this</p>
etc...
but when I view the page - the text is not green...
Q: how do I get the php style '.title-text' to work?