Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS How to solving : CSS selector “:active” not working ?

  • This topic is empty.
Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #38921
    JuanLie
    Member

    I’m very confused, because :hover selector was working normaly, but active not working.
    The code:

    ::CSS::
    #working

    #selec:hover{background-color:blue;}

    #not work

    #selec:active{background-color:red;}

    ::PHP::

    ">

    Anyone can help me? Thank you

    #106136
    wolfcry911
    Participant

    JuanLie, you really need to better explain the problem and give some code or link.

    I’ll take a guess and assume you think that the active psuedo class should work for navigation when on a certain page – it doesn’t. Active is when the link or element is actually being selected, like when you’re mouse clicking on a link.

    If this is true, then simply use php to add an active class to the link or div in question

    #106137
    AntonNiklasson
    Participant

    I guess if you do it like this it won’t work:
    http://codepen.io/AntonNiklasson/pen/21/2

    If that’s you problem, put the :active below the :hover.

    #106139
    JuanLie
    Member

    @wolfcry911 : would you please to solve my problem, please?

    @AntonNiklasson
    : its same, not working, I have gave up for this problem :(.

    #106187
    Schmotty
    Participant

    I have had this problem before. I believe you need to order them correctly. link, active, hover, visited. Hover will work by itself, but active and visited will only work if it follows link.

    #106194
    snillor
    Member

    Yes, the order in which you style the links matters.

    But I thought the recommended order is link, visited, hover, focus, active (I remember it with Lord Vader’s Handle Formerly Annakin). Am I wrong? Has that changed?

    #106496
    JuanLie
    Member

    xxx

Viewing 7 posts - 1 through 7 (of 7 total)
  • The forum ‘CSS’ is closed to new topics and replies.