Applying the transient CSS style to an element

K

kwicher

Hi!

I hope I will be able to escribe my problem clear enough.
So I have the following definition in CSS file.
#links {
......
}
#links a {
........
}
#links a:hover {
......
}

In html file I have a few links placed within
<div id="links">
<a ....>
<a....>
....
</div>

And now the problem is as follows. After clicking one of the links I
would like to apply a new style to it eg different background at
normal and hover state. Then when another link is clicked i would like
to apply this new style to a new link and the former should now behave
as original link.

how to do it?

I would be thankful for any help

XY$
 
I

Ian Collins

Hi!

I hope I will be able to escribe my problem clear enough.
So I have the following definition in CSS file.
#links {
......
}
#links a {
........
}
#links a:hover {
......
}

In html file I have a few links placed within
<div id="links">
<a ....>
<a....>
....
</div>

And now the problem is as follows. After clicking one of the links I
would like to apply a new style to it eg different background at
normal and hover state. Then when another link is clicked i would like
to apply this new style to a new link and the former should now behave
as original link.

how to do it?
You could assign a css class to the links and swap to an alternative
when the link is clicked, swapping back when another link is clicked.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,778
Messages
2,569,605
Members
45,237
Latest member
AvivMNS

Latest Threads

Top