|
Convenient web based access to our favorite web design Usenet groups
|
 |
This is Interesting: Free Magazines for Graphics designers and webmasters
| Author |
| Thread |
 |
|
|
|
|
|
 |
 |
|
|
 |
|
|
 |
 |
Re: changing the color of the active link |
 |
|
 |
|
|
|
  08-26-04 - 05:28 PM
|
Carla wrote:
> I have 4 links, I want that when I click/mouseover in the link 1, it
> turns to a color a, then when I click/mouseover over the link 2, it
> turns to a color b and the link 1 turns to the normal link color
> again. (an so with the other links).
Well, basically a link can have four states according to CSS:
:link for non-visited links,
:visited, for... visited links,
:hover when the user is passing the mouse over it,
:active when the link is being selected (keyboard or mouse)
So if you have something like:
<a id="one" href="..."></a>
<a id="two" href="..."></a>
You could use the following CSS rules:
a#one:link, a#one:visited { color: blue ; }
a#one:hover { color: green ; }
a#one:active { color: red ; }
This way, your link will be blue in normal state, green when the mouse
passes over it, and red when the user presses the mouse button while on
it. It will turn back to blue when the user releases the button.
If this is what you want, do the same with your other links (with
appropriate colors...)
--
Want to spend holidays in France ? Check http://www.relinquiere.com/
|
|
|
| [
Post Follow-Up to this message ]
|
|
|
|
|
 |
 |
Re: changing the color of the active link |
 |
|
 |
|
|
|
  08-26-04 - 05:28 PM
|
Merci Beaucoup Vincent! :)
But I have another thing, say I have all the links in the color 0,
when I do a mouseout over the link 1, I want it to pass to the color 1
and stay in that way even if I put the mouse away of the link.
When I do a mouseover over the link 2 i want the link 1 to change to
the color 0 (normal) and the link 2 to change to the color 2. And the
link 2 should stay in the color 2 when I put the mouse away
(onmouseout).
I tried to do it with this.style.color but it hasn't worked
best regards,
carla
Vincent Poinot <vincent.use-my-last-name-here@wanadoo.fr> wrote in message news:<cghk85$1tc
$1@news-reader3.wanadoo.fr>...
> Carla wrote:
>
> Well, basically a link can have four states according to CSS:
> :link for non-visited links,
> :visited, for... visited links,
> :hover when the user is passing the mouse over it,
> :active when the link is being selected (keyboard or mouse)
>
> So if you have something like:
> <a id="one" href="..."></a>
> <a id="two" href="..."></a>
>
> You could use the following CSS rules:
> a#one:link, a#one:visited { color: blue ; }
> a#one:hover { color: green ; }
> a#one:active { color: red ; }
>
> This way, your link will be blue in normal state, green when the mouse
> passes over it, and red when the user presses the mouse button while on
> it. It will turn back to blue when the user releases the button.
> If this is what you want, do the same with your other links (with
> appropriate colors...)
|
|
|
| [
Post Follow-Up to this message ]
|
|
|
|
|
 |
|
|
 |
|
|
 |
|
|
 |
|
|
 |
| All times are GMT. The time now is 03:50 PM. |
 |
|
|
|
|
|  |
|