Noob question: assign color (hex) values via CSS ??

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Dazulrich
Forum Newbie
Posts: 8
Joined: Mon Oct 09, 2006 2:30 pm

Post by Dazulrich »

thanks Ole.. but when I read those colors from SomeColors.php into the css and use that for the html output of my php file - I still have two different places where I define define colors... (like I have now)

I will send you PM trying to explain it with more details.

@cinac: I don't think I can't keep it down as I have some mouseover calls that require "magic numbers" as values passed in -

like I posted before: <td height='50' class='FOO' align='center' valign='top' onmouseover="...., cOn(this,'#dd0066')

where I pass the color for cOn(this,'#dd0066') as variable cOn(this,'$foo') <- pseudo code....
with $foo defined in the same php file - ass works, but i want to keep those colors central in the CSS with all other color defs.

so no CSS styling as such...

@Rovas: any pointer??? please....
User avatar
Ollie Saunders
DevNet Master
Posts: 3179
Joined: Tue May 24, 2005 6:01 pm
Location: UK

Post by Ollie Saunders »

Please don't PM, post here. Don't worry if there is lots of code.
Dazulrich
Forum Newbie
Posts: 8
Joined: Mon Oct 09, 2006 2:30 pm

Post by Dazulrich »

ok, I think I finally copped it...
Lesson1: Try to understand what the code is doing before asking stupid questions you can't explain properly....

I think I will go about the whole problem differently.
Basically what the code is doing is highlighting table cells on hover with with different colors depending on the type of cell.
Right now it uses Javascript c0n and c0out functions to pass a color value into the function. This is the color value I was trying to pass via CSS instead of php variable.

I was reading up a bit about the whole thing and I will try replacing the javascript code with pure CSS....

While the principle hover CSS works, I now need to figure out how I make the color depended on the cell I hover over.
But that is a different forum to help out :-)

thanks everyone.

[edit]: and its already working the way I wanted it !!! hooraayyy :-)
User avatar
Ollie Saunders
DevNet Master
Posts: 3179
Joined: Tue May 24, 2005 6:01 pm
Location: UK

Post by Ollie Saunders »

Glad it worked out.
Even more glad you learned something from it.
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Post by RobertGonzalez »

Good job. Glad you got it all figured out.
Post Reply