style sheet a:hover

L

Luc

Hello,

In a style sheet i defined this :

a:link { text-decoration: none;}
a:hover { text-decoration: underline;}
a:visited { text-decoration: none;}
a:active { text-decoration: none;}

i cannot understand why the link is not underlined when the mouse is over...
 
L

Luc

(message sent before i finished writing :)

Hello,

In a style sheet i defined this :

a:link { text-decoration: none;}
a:hover { text-decoration: underline;}
a:visited { text-decoration: none;}
a:active { text-decoration: none;}

i cannot understand why the link is not underlined when the mouse is over...

thanks for your help
 
I

Inger Helene Falch-Jacobsen

Luc said:
(message sent before i finished writing :)

Hello,

In a style sheet i defined this :

a:link { text-decoration: none;}
a:hover { text-decoration: underline;}
a:visited { text-decoration: none;}
a:active { text-decoration: none;}

i cannot understand why the link is not underlined when the mouse is
over...

thanks for your help

You have to put the "commands" in the right order. Try this:

a:link { text-decoration: none;}
a:visited { text-decoration: none;}
a:hover { text-decoration: underline;}
a:active { text-decoration: none;}
 
E

Els

Luc said:
(message sent before i finished writing :)

Hello,

In a style sheet i defined this :

a:link { text-decoration: none;}
a:hover { text-decoration: underline;}
a:visited { text-decoration: none;}
a:active { text-decoration: none;}

i cannot understand why the link is not underlined when the mouse is over...

You probably already visited the link once.
And a:visited was defined after a:hover, so it 'goes for'
the a:visited style.

Stick to the order:
a:link { text-decoration: none;}
a:visited { text-decoration: none;}
a:active { text-decoration: none;}
a:hover { text-decoration: underline;}
thanks for your help

You're welcome :)
 
P

picayunish

Inger said:
You have to put the "commands" in the right order. Try this:

a:link { text-decoration: none;}
a:visited { text-decoration: none;}
a:hover { text-decoration: underline;}
a:active { text-decoration: none;}

Why not a:link, a:active, a:visited, a:hover in order of commands?
 
T

Toby A Inkster

Els said:
Stick to the order:
a:link { text-decoration: none;}
a:visited { text-decoration: none;}
a:active { text-decoration: none;}
a:hover { text-decoration: underline;}

Depending on the effect you are trying to create, you will probably want
:hover before :active.
 
E

Els

Toby said:
Els wrote:



Depending on the effect you are trying to create, you will probably want
:hover before :active.

Yes, I was thinking about that, but couldn't resolve the
answer. I was thinking: if a link is active (meaning the
page connected by that link is open, maybe in another
window, right?), and then you hover over it.. does it have
to show you are hovering, or not?
Or maybe active means just the fraction of a second that you
are pressing the link?

On the site I did, I ignored this whole issue, by not using
the a:active styles at all ;-)
 
D

David Dorward

picayunish said:
Why not a:link, a:active, a:visited, a:hover in order of commands?

Because[1] you can't have a link :active without it also being :hover. So
the :hover declaration would override the :active declaration (as
would :visited)

[1] At least when a pointing device is being used for navigation.
 
U

Unregistered

Luc said:
*Hello,

In a style sheet i defined this :

a:link { text-decoration: none;}
a:hover { text-decoration: underline;}
a:visited { text-decoration: none;}
a:active { text-decoration: none;}

i cannot understand why the link is not underlined when the mouse i
over... *

afaik the correct order is:
a:link
a:visited
a:hover
a:active
this order seems compulsory
Pete

Unregistered
 
P

picayunish

David said:
picayunish wrote:

Why not a:link, a:active, a:visited, a:hover in order of commands?


Because[1] you can't have a link :active without it also being :hover. So
the :hover declaration would override the :active declaration (as
would :visited)

[1] At least when a pointing device is being used for navigation.

I see.
So when the link is active, then it will override the other
declarations. But when you would also to visit an other link of the
previous page (in a new tab/window), the hover effect (on the previous
page) is overriding by :active declaration. Perhapse the OP would like
to have the :hover declaration active.
What's the best way to have the right commands with an :active declaration?
 
D

David Dorward

picayunish said:
So when the link is active, then it will override the other
declarations.

No it won't. The declarations will apply in the order they appear in the
source (and according to the rules of specificity[1])
But when you would also to visit an other link of the
previous page (in a new tab/window), the hover effect (on the previous
page) is overriding by :active declaration.

I'm sorry, I have no idea what this sentence is supposed to mean.
Perhapse the OP would like to have the :hover declaration active.

Assuming you mean "Would like to have the style using :hover apply when the
link is :active" then the style including :active need not be specified at
all.
What's the best way to have the right commands with an :active
declaration?

The way the specification states one should specify them in.

http://www.w3.org/TR/CSS2/selector.html#dynamic-pseudo-classes

[1] anything:anything will always have the same specificity as
anythingelse:anythingelse
 
B

Beauregard T. Shagnasty

Quoth the raven named Unregistered:
afaik the correct order is:
a:link
a:visited
a:hover
a:active
this order seems compulsory
Peter

Someone had posted a mnemonic here awhile ago. Not sure of the exact
words and all I can think of at the moment is:
"Las Vegas Has Animals"
L. V. H. A.
 
T

Toby A Inkster

Els said:
Okay, so I'd say the order has to be link, visited, hover,
active then.

Well, it doesn't *have* to be. It depends on the effect that you want to
create. You could for example use link, hover, active, visited: this would
have the effect that any styles in visited would over-ride hover and
active styles, but this may have been what you wanted!
 
P

picayunish

David said:
picayunish wrote:

So when the link is active, then it will override the other
declarations.


No it won't. The declarations will apply in the order they appear in the
source (and according to the rules of specificity[1])

But when you would also to visit an other link of the
previous page (in a new tab/window), the hover effect (on the previous
page) is overriding by :active declaration.


I'm sorry, I have no idea what this sentence is supposed to mean.

Perhapse the OP would like to have the :hover declaration active.


Assuming you mean "Would like to have the style using :hover apply when the
link is :active" then the style including :active need not be specified at
all.

What's the best way to have the right commands with an :active
declaration?


The way the specification states one should specify them in.

http://www.w3.org/TR/CSS2/selector.html#dynamic-pseudo-classes

[1] anything:anything will always have the same specificity as
anythingelse:anythingelse

Thanx for the explanation.
 
L

Luc

Thanks a lot, it works

In fact i did not create them in the rigth order and Dreamweaver, which i
use, does not give me the possibility to sort them or change the order..
then i just edited the style sheet and it works.

Thanks again to all of you
Luc
 
R

Richard Rundle

Someone had posted a mnemonic here awhile ago. Not sure of
the exact
words and all I can think of at the moment is:
"Las Vegas Has Animals"
L. V. H. A.

I seem to remember :

Luther Vandross Has Acne.
 

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,744
Messages
2,569,482
Members
44,900
Latest member
Nell636132

Latest Threads

Top