Sarah Atkinson wrote:
Out of curiosity can you use PHP with in a CSS. Like maybe have a list of background images located in a DB and PHP select and insert on into the CSS. and possibly even have the user define things like font size, font color, background color, and typeface.

Sure. php runs on the server, and thus, will populate the varibles into the Style part of your tags before the page is exported as (x)html.


for example:

<?php
        if($pagename="home")
        {
                $background = "#fff;";
        }
        else
        {
                $background = "#ccc;";
        }
?>

<html  . . . . .

<style type="text/css" media="all">
        body { background: <?php echp $background; ?>; }
</style>
.
.
.

</html>



on the browser, you will only see the generated css/html.

<style type="text/css" media="all">
        body { background: #fff; }
</style>

for the pagename of "home"
and


<style type="text/css" media="all"> body { background: #ccc; } </style>

for all other page names.

HTH


______________________________________________________________________ css-discuss [EMAIL PROTECTED] http://www.css-discuss.org/mailman/listinfo/css-d List wiki/FAQ -- http://css-discuss.incutio.com/ Supported by evolt.org -- http://www.evolt.org/help_support_evolt/

Reply via email to