style sheet a:hover

Discussion in 'HTML' started by Luc, Feb 14, 2004.

  1. Luc

    Luc Guest

    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...
     
    Luc, Feb 14, 2004
    #1
    1. Advertising

  2. Luc

    Luc Guest

    (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
     
    Luc, Feb 14, 2004
    #2
    1. Advertising

  3. Luc wrote:
    > (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;}

    --
    Inger Helene Falch-Jacobsen
    http://home.online.no/~ingerfaj/
     
    Inger Helene Falch-Jacobsen, Feb 14, 2004
    #3
  4. Luc

    Els Guest

    Luc wrote:

    > (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 :)

    --
    Els

    Mente humana é como pára-quedas; funciona melhor aberta.
     
    Els, Feb 14, 2004
    #4
  5. Luc

    picayunish Guest

    Inger Helene Falch-Jacobsen wrote:
    > Luc wrote:
    >
    >>(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;}


    Why not a:link, a:active, a:visited, a:hover in order of commands?
    --
    Edwin van der Vaart
    http://www.semi-conductor.nl/ Links to Semiconductors sites
    http://www.evandervaart.nl/ Under construction
     
    picayunish, Feb 14, 2004
    #5
  6. Els wrote:

    > 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.

    --
    Toby A Inkster BSc (Hons) ARCS
    Contact Me - http://www.goddamn.co.uk/tobyink/?page=132
     
    Toby A Inkster, Feb 14, 2004
    #6
  7. Luc

    Els Guest

    Toby A Inkster wrote:

    > Els wrote:
    >
    >
    >>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.


    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 ;-)


    --
    Els

    Mente humana é como pára-quedas; funciona melhor aberta.
     
    Els, Feb 14, 2004
    #7
  8. 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.

    --
    David Dorward <http://dorward.me.uk/>
     
    David Dorward, Feb 14, 2004
    #8
  9. Toby A Inkster, Feb 14, 2004
    #9
  10. Luc

    Els Guest

    Toby A Inkster wrote:

    > Els wrote:
    >
    >
    >>Or maybe active means just the fraction of a second that you
    >>are pressing the link?

    >
    > Yep, that's it. Go to:
    >
    > http://www.goddamn.co.uk/tobyink/setstyle.php?style=default
    >
    > Click on the links and you should notice a lime colour for active links.


    Yep, nice colour too ;-)
    Okay, so I'd say the order has to be link, visited, hover,
    active then.
    I stand corrected.
    Thanks :)

    --
    Els

    Mente humana é como pára-quedas; funciona melhor aberta.
     
    Els, Feb 14, 2004
    #10
  11. Luc

    Unregistered Guest

    Luc wrote:
    > *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
    -----------------------------------------------------------------------
    Posted via http://www.forum4designers.co
    -----------------------------------------------------------------------
    View this thread: http://www.forum4designers.com/message45434.htm
     
    Unregistered, Feb 14, 2004
    #11
  12. Luc

    picayunish Guest

    David Dorward wrote:
    > 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?
    --
    Edwin van der Vaart
    http://www.semi-conductor.nl/ Links to Semiconductors sites
    http://www.evandervaart.nl/ Under construction
     
    picayunish, Feb 14, 2004
    #12
  13. 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

    --
    David Dorward <http://dorward.me.uk/>
     
    David Dorward, Feb 14, 2004
    #13
  14. Quoth the raven named Unregistered:

    > Luc wrote:
    >
    >>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... *

    >
    > 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.

    --
    -bts
    -This space intentionally left blank.
     
    Beauregard T. Shagnasty, Feb 14, 2004
    #14
  15. Els wrote:

    > 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!

    --
    Toby A Inkster BSc (Hons) ARCS
    Contact Me - http://www.goddamn.co.uk/tobyink/?page=132
     
    Toby A Inkster, Feb 14, 2004
    #15
  16. Luc

    picayunish Guest

    David Dorward wrote:
    > 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.
    --
    Edwin van der Vaart
    http://www.semi-conductor.nl/ Links to Semiconductors sites
    http://www.evandervaart.nl/ Under construction
     
    picayunish, Feb 14, 2004
    #16
  17. Luc

    Luc Guest

    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
     
    Luc, Feb 14, 2004
    #17
  18. "Beauregard T. Shagnasty" <> wrote in message
    news:H8tXb.56927> 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.

    --
    Richard
     
    Richard Rundle, Feb 15, 2004
    #18
  19. Luc

    Mark Parnell Guest

    On Sat, 14 Feb 2004 17:45:11 GMT, "Beauregard T. Shagnasty"
    <> declared in alt.html:
    >
    > Someone had posted a mnemonic here awhile ago.


    LoVe HAte

    --
    Mark Parnell
    http://www.clarkecomputers.com.au
     
    Mark Parnell, Feb 15, 2004
    #19
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Ryan

    Hover Style property

    Ryan, Sep 11, 2003, in forum: HTML
    Replies:
    1
    Views:
    454
  2. Dave Brown
    Replies:
    9
    Views:
    715
  3. Steve Gouldstone

    CSS hover style affects image hotspots

    Steve Gouldstone, Feb 6, 2006, in forum: HTML
    Replies:
    5
    Views:
    10,172
  4. Replies:
    0
    Views:
    519
  5. Asp .net 2.0 Menu Hover style

    , Apr 6, 2006, in forum: ASP .Net Web Controls
    Replies:
    0
    Views:
    280
Loading...

Share This Page