Required to set background color for menu

Hi friends,

i had created a site in joomla, with 5 menus and two submenu for two parent menu. My main menus are listed below


2.About us

 2.1 Home
 2.2 Advantages
 2.3 Brief
  1. Services

    3.1 Home
    3.2 Sample

  2. Careers

. I want to set active menu item background-color as blue. So for this my syntax is #menu ul a { background-color:blue; }

But unfortunately it is applicable for home menu only. When i clickmenu (active id=“current”) it available only for home. Remaining menus doesn’t contain id=“current” where relevant select. So any body clarify this.

Hi joomlaforums. Welcome to the SitePoint forums. :slight_smile:

You can do this with CSS, or JavaScript, or PHP, as discussed here:

However, Joomla probably has some inbuilt functions for this, so I’d check that out too. for example, other CMSes can look at the current URL and ass in the “current” class/ID if the URL of the page matches the URL in the link. So I’d check that out first. (I don’t know Joomla.)