Re: php and CSS level 2

From: Date: Sun, 21 Mar 2004 04:02:40 +0000
Subject: Re: php and CSS level 2
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-181068@lists.php.net to get a copy of this message
Why not just make your CSS script end with the .php extension instead of .css? Then, the server will automatically parse it (most likely it will--depending on your server setup, of course). You can link to it from your HTML page like you would your CSS: <style type="text/css"> <!-- @import url("/path/to/css.php"); --> </style> or <link href="/path/to/css.php" rel="stylesheet" type="text/css" /> Aidan Lister wrote:
Your question indicates you have very little understanding of what PHP actually is. PHP will be parsed anywhere in any script, as long as your webserver is set to parse that type of file (ie, .php by default). 1. In your webserver config you need to make .css files parsed by php 2. Like you've done in your code snip? I suggest you a) read the manual b) experiment before asking further questions. "Andy B" <aborka1@wmis.net> wrote in message news:003201c40ee3$142bdb00$34c66dd8@andy... was just wondering if php will work inside a CSS level 2 style sheet?? for example: <?php ?> <style type="text/css"> <?php if(!empty($name)){ ?> input#name { display: none } <?php } else { ?> input#name { font-family: Arial, serif; font-size: 12pt; color: blue; background-color: transparent; ..... } <?php } ? /*rest of style sheet */ </style> if this will work i was wondering 2 things: 1. how would i have to set it up to work right with the style sheet with php in it to work as a seperate file from the html file and 2. how would i set the style sheet up to work inside the original html/php file that contained the original html code...
-- Regards, Ben Ramsey http://benramsey.com http://www.phpcommunity.org/wiki/People/BenRamsey

« previous php.general (#181068) next »