How to set active links in menus

Created on 29 December 2023, 11 months ago
Updated 27 June 2024, 5 months ago

Problem/Motivation

I need to display active links

Steps to reproduce

I have copied menu--responsive-v.html.twig to my menu menu--c.html.twig
where I have added

<style>
a:active { font-weight: bold; background-color: orange; }
</style>

The effect is only visible when clicking the link but it does not remain after.

What I'm doing wrongly, or how should I do it to accomplish it?
thanks!!

💬 Support request
Status

Fixed

Version

2.0

Component

Miscellaneous

Created by

🇨🇱Chile Andrés Chandía

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @Andrés Chandía
  • Status changed to Fixed 11 months ago
  • 🇺🇸United States flashwebcenter Austin TX

    Hello,
    The active class for the

  • , so it will be li.active > a { font-weight: bold; background-color: orange; }

    Best wishes,
    Alaa

  • Status changed to Active 11 months ago
  • 🇨🇱Chile Andrés Chandía

    Thanks a lot Alaa, just another little question, what's the documentation to learn all these insights of css coding for your theme?

  • Assigned to flashwebcenter
  • Status changed to Fixed 11 months ago
  • 🇺🇸United States flashwebcenter Austin TX

    Sorry, I just saw it now. The active class is added by Drupal, I would recommend using google inspector to discover the classes while clicking around.

    Best wishes,
    Alaa

  • Automatically closed - issue fixed for 2 weeks with no activity.

  • 🇺🇸United States flashwebcenter Austin TX
  • Production build 0.71.5 2024