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" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
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

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Reply via email to