title: How can I use php to generate css?
body: <p>In my first version of this question, I did not offer enough information, I am sorry. Here is a clearer version of what help I need. Many of your answers are close already, this will help:</p>
  
  <p><strong>Much More Specific Version of This Question:</strong></p>
  
  <p>I've decided to use php with css to make my pages work more efficiently than they would if I were to achieve the same outcome with javascript. This is not important. What's important is that the two methods that I have tried to do this (as shown in a tutorial) are:</p>
  
  <p>adding </p>
  
  <pre><code>AddType application/x-httpd-php .css
  </code></pre>
  
  <p>to my .htaccess</p>
  
  <p>Then, when the style sheet showed up in the page's sources but did not have an affect on the page I tried using</p>
  
  <pre><code>&lt;link rel="stylesheet" href="style.php" media="screen"&gt;
  </code></pre>
  
  <p>to link my stylesheet as a php file, as suggested by this tutorial. <a href="http://www.phpro.org/articles/Embedding-PHP-In-CSS.html">http://www.phpro.org/articles/Embedding-PHP-In-CSS.html</a></p>
  
  <p>Here was the css that I was testing with the php variables: </p>
  
  <pre><code>&lt;?php
  /*** set the content type header ***/
  header("Content-type: text/css");
  
  /** set the paragraph color ***/
  $para_color = '#0000ff';
  
  /*** set the heading size ***/
  $heading_size = '2em';
  
  /*** set the heading color ***/
  $heading_color = '#c0c0c0';
  ?&gt;
  
  p{
      color: &lt;?php echo $para_color;  ?&gt;;
      font-weight: bold;
      font-size: 1.2em;
      text-align: left;
  }       
  
  h1{
      color: &lt;?php echo $heading_color; ?&gt;;
      font-size = &lt;?php echo $heading_size; ?&gt;;
      text-align: centre;
  }
  </code></pre>
  
  <p>Both methods gave me the same outcome, with the css showing up exactly as is should as a stylesheet source, but not showing up on the page UNLESS I made a change to the style in the page's dev tools, after which the page would style just fine. </p>
  
  <p><strong>Question: Why is this happening, and how do I fix it?</strong></p>
  
  <p><strong>Old Version:</strong></p>
  
  <p>The question here is a simple one: </p>
  
  <p><strong>How can I use PHP in CSS?</strong> </p>
  
  <p>I am creating a website where it will be much more efficient both in time and in processing speed for me to use php within CSS to achieve various desired results, rather than using javascript. </p>
  
  <p>I'm told that this can be done. How?</p>