Dynamically change css in php? -


i have little question. can dynamically change (with php) content of css style in way?

<?php                header("content-type: text/css; charset: utf-8");                 $color = "red;";                 ?>                 header      {                             color:<?php print $color; ?>                             }      ?> 

sure it's possible, why not give try?

linking php css in html:

<link rel="stylesheet" type="text/css" href="css/name-of-file.css.php"> 

and in css.php file put code, without

<style type="text/css"> 

so should this

 <?php            header("content-type: text/css; charset: utf-8");            $color = "red;";            ?>             header      {                         color:<?php print $color; ?>                         }     

Comments

Popular posts from this blog

java.util.scanner - How to read and add only numbers to array from a text file -

rewrite - Trouble with Wordpress multiple custom querystrings -