Forums

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

Home Forums CSS Trying to change the style of my menu's current selected item, but not working?

  • This topic is empty.
Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #190079
    iizag
    Participant

    I am referring to the menu next to my logo that says , “Join , Forums, and Groups” http://bitfiu.com/ . When you click on Forums, for example, I want to know how I can keep the selected Menu item “Forums” with a border under it. How would I change the style of the header menu for a current selected item?

    I have tried

    header .tile-title .selected

    and even tried using active , and #current but nothing has taken effect

    #190097
    Paulie_D
    Member

    How are you applying the .selectedclass?

    If you’re not actually applying a class manually then you need a JS solution unless you have a site with a limited number of pages.

    One that looks at the current page URL, checks it against each link in your menu and if they match apply a class of ‘current’ (or whatever).

    #190101
    Paulie_D
    Member

    Then again, if this is WordPress…there is a ‘current page’ class setting I think.

    If so, you might want to ask this question in that area.

    #190110
    iizag
    Participant

    Maybe slected is not what I mean, I tried this with no luck either:

    ‘header .tile-forums:active’

    #190112
    Paulie_D
    Member

    :active isn’t a ‘click’ thing.

    It’s a mousedown thing.

    In other words it only applies to the current element when the mouse is clicked down and is removed when the mouse button is unclicked. It doesn’t apply a special class it’s an entirely transitory pseudoclass.

    For permanence you need either a proper selector or have a class applied by Js.

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