Hey all,
This is my first post. I'm relatively new to Web design, but have a good grasp of client-side scripting and HTML. I've decided recently to explore server-side scripting technologies like .ASP and PHP.
My question is, i'm trying to convert my existing .css file to .php in order to use variables to facilitate updates to my file.
I used
http://www.barelyfitz.com/projects/csscolor/ as a starting point and have been absorbing the HP case example (
http://www.barelyfitz.com/projects/cssc ... -study-hp/ ) to try and enlighten myself.
Well, I'm stuck and am unsure what is wrong and how to proceed. I'm enclosing an example of my CSS file (csscolor.php) and the document which is trying to make use of the styles (refinePHP.php)
Here's the 'csscolor.php' style sheet document :
Code: Select all
<?php
header("Content-type: text/css");
/* setup the data structure for Refine's colour scheme
$refineColor = array(
'grey01' => array(
'a' => 'e6e6e6',
'b' => 'cccccc',
'c' => '666666'),
'blue01' => array(
'a' => '66ccff',
'b' => '3399cc',
'c' => '006699'),
'blue02' => array(
'a' => '99ccff',
'b' => '6699cc',
'c' => '336699'),
'green01' => array(
'a' => '99cccc',
'b' => '669999',
'c' => '336666'),
'green02' => array(
'a' => 'cccc99',
'b' => '999966',
'c' => '666633'),
'orange01' => array(
'a' => 'ffcc66',
'b' => 'ff9900',
'c' => 'ff6600'),
'orange02' => array(
'a' => 'ff9966',
'b' => 'cc6633',
'c' => '993300'),
'red01' => array(
'a' => 'ff9999',
'b' => 'cc6633',
'c' => 'cc3333'),
'red02' => array(
'a' => 'ffcccc',
'b' => 'cc9999',
'c' => '996666'),
);
/* chosen colour scheme
$color = array(
1 => $refineColor['grey01'],
2 => $refineColor['blue02'],
3 => $refineColor['green01'],
);
?>
a { text-decoration: none}
img { border: none }
body { font-family: verdana;
font-size: 12pt }
.blueBox { background-color: #<?=color[3]['c']?>;
border: 2px outset gray;
padding: 8px 12px;
font-size: 8pt;
color: #<?=$color[3]['c']?>}
div.header { width: 100%;
vertical-align: middle;
height: 125px }
div.footer { width: 100%;
height: 50px }
...and here is the document in which i'm trying to make use of the styles :
Code: Select all
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<link rel="stylesheet" type="text/css" media="screen" href="csscolor.php">
<?php
include_once("csscolor.php");
?>
<head>
<title>Refine Industries Inc. - </title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body bgcolor="#<?=$color[2]['a']?>">
<div class="blueBox">
<p>Yadda yadda yadda yadda yadda
</div>
</body>
In the above example, I tried using the $color variable directly in trying to assign a background color in the <BODY> tag, and I also tried accessing the .blueBox class in the <DIV> tag.
I appreciate any help that can be offered and I am open to constructive critisism
