On Aug 6, 2005, at 1:44 PM, Richard Hawking wrote:

I was wondering if it's possible to use a PHP echo within CSS styling. Something like:

#<?php echo $pageId; ?> #<?php echo $navId; ?> {color:#666666;}

Would this work? If so, is it advisable to do this kind of thing?

Well I think PHP is inadvisable, but that would probably not be a helpful comment so I won't say it :-) :-) :-)...

Sure, it'll work. You have to make sure that this css is in a resource that's going to be generated by PHP, but I'm sure you know the various ways to do that (if not, plz contact me off-list as this would be OT for css-discuss).

Notes:

1) There are surely less hacky ways of doing what you're trying to do (styling nav links in context of current page?)

2) In PHP, this:

        <?=$pageId?>

...is the same as

        <?php echo $pageId?>

 :-)
—ml—

______________________________________________________________________
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