• Hi,

    In my navigation I wan’t to change the colour of the bullet on <li> when a section is “highlighted”.

    I’m not sure this is possible without having class “highlight” on the <li> element like so:

    <nav>
    <ul>
    <li class="highlight"><a href="#section1">Section 1</a></li>
    <li><a href="#section2">Section 2</a></li>
    </ul>
    </nav>

    And the plugin adds the class to the hyperlink element as default:

    <nav>
    <ul>
    <li><a href="#section1" class="highlight">Section 1</a></li>
    <li><a href="#section2">Section 2</a></li>
    </ul>
    </nav>

    Any way to select the <li> element as to where the classes are added? And if this can be solved with pure CSS then thats fine too.

    • This topic was modified 5 years, 10 months ago by ja152.
    • This topic was modified 5 years, 10 months ago by ja152.
    • This topic was modified 5 years, 10 months ago by ja152.
    • This topic was modified 5 years, 10 months ago by ja152.
Viewing 1 replies (of 1 total)
  • Plugin Author malihu

    (@malihu)

    Hi,

    The plugin highlights only the link itself. You cannot really do what you describe via CSS either, because you can’t target previous or parent elements with pure CSS.

    This said, if you could show me your page or what you want to achieve I might be able to provide an alternative solution (e.g. maybe using the adjacent or siblings CSS selectors).

    Let me know

Viewing 1 replies (of 1 total)

The topic ‘Class on LI element’ is closed to new replies.