What I’d like to do here is, create a PNG image in Photoshop, of some text in a non-web-friendly typeface. In white. On a transparent background.
Put that image on my webpage, and using CSS somehow get the contents of the image, but not the transparent bits, to be able to change to any colour the page so desires.
The end product would be for the title of the webpage to change to a colour befitting the random background image selected.
I’ve messed around with using background-color but that obviously changes the transparent background.. not the contents of the image
No the user wouldn’t be able to do the change.
And the body id thing wouldnt work either.
What I mean is, the background for every page is random. So every time the same page is viewed or refreshed, a most probably new, random background is picked out.
So what I’m looking for is a flexible piece of CSS that I could easily use in this case, to change the colour of the text in my PNG title image.
and thats exactly what I want.
or for the server to change one css value, the hex value or whatever it would need to be, which relates to the image
Here is what i came uo with:
Didnt test for myself but i guess it works
I think first solution is bit better because you have more control of what colors to display in your page. You can change your code too if you want. instead changing classes you can change hex value inside your class. But then you have to remember that php code have to be before the css class code
You must be logged in to reply to this topic.