Web programming >> text/links colors
Posted by kpyro on 14:02:00 07-01-2002
How do you make text/links' colors change gradually? Example: the color of THIS would change to light blue to blue to dark blue if I hovered over it.

thanx
Posted by AntiHalcyon on 14:43:00 07-01-2002
for the link:
<a href="http://www.whatever.com/" style="text-decoration: none">

Then near the top of your code (in the header) do the following:


<style>
A:hover{text-decoration:none; color: #000033};
</style>

For your information the hex value of 0x000033 is dark blue.
Posted by KaGez on 18:27:00 07-01-2002
you could also do it like this:

<style>
a.<class> { <styleinformation> }
a.<class>:hover { <styleinformation> }
a.<class>:visited { <styleinformation> }
</style>

<a href="<url>" class="<class>">


_________________
cheers



KaGez

[ This Message was edited by: KaGez on 2002-07-01 21:38 ]
Posted by sacah on 18:41:00 07-01-2002
You would need to make a javascript function to fade colors, then just activate it with the onmouseover from the link you wish to fade.
Posted by KaGez on 21:38:00 07-01-2002
sorry about the above, forgot to disable HTML
[addsig]
Posted by Henning on 23:16:00 07-01-2002
i think you can meke it so:
<font color="red" onclick="this.style='blue';"></font>

_________________
Henning

[ This Message was edited by: Henning on 2002-07-01 23:16 ]
Posted by kpyro on 02:28:00 07-02-2002
I dont think anyone except sacah understood what I was saying. I want the link color to change to a different color, gradually. FOR instance:

this is a link

If I hover over it, it would turn from say red to dark blue, to a blue, to light blue.

Now do you guys understand?
Posted by dxprog on 03:26:00 07-02-2002
sacah's right. To do domething like that you would have to write a JavaScript function. Like say :

function Change_Link_Color(obj, color)
{
obj.style.color = color;
}

<div id="thing1" style="color: #000000"><a href="link" onMouseOver="Change_Link_Color('thing1', '#555555');">This is a link</a></div>

To do a changing routine would be something more involved but that shouild give you a head start. [addsig]
Posted by sacah on 17:56:00 07-02-2002
There are plenty of BG fader scripts, use these to get the color fading code, most of these BGcolor faders were IE only when I was looking at them a while ago. So depending on what you wanted.
(-:
Posted by KaGez on 22:56:00 07-02-2002
that's _exactly_ what I've posted above..... you just have to define the style's color in a different manner ....
[addsig]
Posted by MoX on 01:44:00 07-03-2002
Well, I don't think that a real fading (with more than 2 colors, for those who did not get it so far) is possible with mere stylesheets. JavaScript color fading functions work with every JavaScriptable browser, given that you program them well enough. [addsig]
Posted by dxprog on 02:46:00 07-03-2002
I can't imagine anything with JS being IE only considering Netscape made the language. [addsig]
Posted by MoX on 04:06:00 07-03-2002
Well, there are things. That's simply because the browsers interpret the scripts in different ways. Also the DOM (Document Object Model) is different in both browsers. [addsig]
Posted by sacah on 16:50:00 07-03-2002
When I was looking a while ago, IE was the thing to program in, It still mostly is, so you might need to find a few scripts before you will get on thats cross platform, its all about how the DOM is for the browser, there are ways to do it cross platform, but in the early days the browsers were very different, so it was usually easier to do it the IE way, hence it being IE only.

If you code it right it will be cross platform.

The actuall fading script would not be IE only, but where it interacts with objects it would be, I though you would understand what I meant, seems not
(-:
Posted by dxprog on 23:23:00 07-03-2002
Amazing how fast IE took over Netscape. Of course bundling it with Windows probobly did the trick. [addsig]
Posted by MoX on 04:30:00 07-04-2002
Yeah. And IE is a really good browser, no matter what some people say. What I don't like about it is that MS wants to create their own standards. When I code a site I'm doing it corresponding to W3C rules.
Gladly Mozilla keeps to them very stricly, so it's maybe the best browser for testing purposes.

What sacah said is totally true. In earlier days browsers were very different. Today all modern browsers can interpret a script in the same way. The problem is, that you can't rely on the users to have a modern browser. So, you still have to do all the different functions for the different browsers to make sure everybody will see the same results. [addsig]
Posted by sacah on 16:48:00 07-04-2002
Netscape created their own standards too, the thing is W3C standards are slow to change, If MS and NS did not create new standards, then W3C would still be in the ice age.
(-:
Posted by KaGez on 11:20:00 07-06-2002
wait, no, NS didn't create _any_ standards. It's mozilla that created most of them afaik
[addsig]
Posted by sacah on 17:04:00 07-06-2002
NS did create a few standards that actually differ from mozilla.
Posted by KaGez on 18:11:00 07-06-2002
really? :/
like? just curious
[addsig]
Posted by MoX on 18:49:00 07-06-2002
Maybe they created these before they started the mozilla project... [addsig]
Posted by dxprog on 20:52:00 07-06-2002
I was actually thinking of downloading Mozilla once. Since they are totally compliant with W3 I might do that. [addsig]
Posted by KaGez on 21:29:00 07-06-2002
yes, do so
no, seriously, mozilla is far better and also shows pictures far cleaner imho. Also colors are better interpreted than in IE... don't ask me why
[addsig]
Posted by MoX on 22:44:00 07-06-2002
Same thing occured to me when I was using IE5 lately. But I have not tested it with a newer version... [addsig]
Posted by dxprog on 02:12:00 07-07-2002
I've never seen any problems when interpretting colors. The colors that I see in PSP are the same in IE. [addsig]
Posted by KaGez on 11:45:00 07-07-2002
compare colors form a CSS in mozilla and IE 6. Those colors in IE6 are far darker. You need a good monitor to see that tho
[addsig]
Posted by sacah on 17:26:00 07-07-2002
I have noticed the color difference a bit in IE6 and Mozilla 1.0, but it was not that greata deal, IE starts up faster, but thats mainly cause its intergrated into the OS, so I got mozilla starting at windows start up, and its just as fast as IE now
(-:

Plus its got tabs, though its bookmark feature is a bit unusable compared to IE.
Posted by KaGez on 00:02:00 07-08-2002
maybe you should install gtk+ for windows and galeon. it works really great and I think there's no better bookmark manager than in galeon!
[addsig]
Posted by fsvara on 01:17:00 07-08-2002
galeon works in windows? doesn't it use some gnome libs?
Posted by sacah on 20:43:00 07-08-2002
Notice he said "install gtk+ for windows"
d-:
Posted by fsvara on 23:06:00 07-08-2002
yes but gtk+ is not a gnome lib... at least not originally. what i meant is, i thought it uses some more libs than gtk that aren't available on windows.