Jump to content

outputting php as css and applying the css to receiving page


pellio

Recommended Posts

hi iv written a css file defining colours as variables then output it as php,brought it into another page and tried to apply the style but it doesnt seem to work.any ideas??im a referencing the class wrongly in the receiving page??cheers

 

 

here is the css page called phpcolour.php:

 

 

<?php

header("Content-type: text/css");

$blue = '#0000FF';

$black = '#000000';

$red = '#FF0000';

?>

 

 

.text

{

color:<?=$blue?>;

}

 

 

.text2

{

color:<?=$red?>;

}

 

 

 

.text3

{

color:<?=$black?>;

}

 

receiving page code:

<html>

<head>

<title>Formatting Output</title>

<link rel="stylesheet" media="screen" type="text/css" href="phpcolor.php">

 

</head>

 

<body>

 

 

 

<p class="text3">

 

 

dghghfgdhf ghdgfhdgfhj gdhjfghjdgfhjd sgfhgdshfhjdgf hjdgfhjgdfhjgdhfghjdsfg ghgdshjf ghghjg gsfhjgdhj ghghg gjhghjg ggggggg ggggggggggggghjgh jghjfghdjsgfhjds ghfjgdhfgh dsgfhdsghfgdhf ghdgfhdshfgdhsg jhjghfghfhgjfh ghfjghdfjghfj dhgjfdhgjdfjghjdfh gjhfdjhgjdfhj ghfdjghfdjghfdgh fdhjghfjhgfhd jhgfdhhgjfhgkfhgj fdhgjfjgfgjgh jfhgfjhgjfdh gjfdhgjfhgjfd hgjfhdkghkdfgfhg fjhjghjfhjgh dfjhgjfdhgg

 

</p>

 

</body>

</html>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.