Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
By webdev100 on
Hi,
I am using bartik theme. I am trying to apply css to main menu links. Hover/focus is working but not active. I am not getting yellow background after I click a link in main menu. Can you please help?
style.css file.
#main-menu-links a:hover,
#main-menu-links a:focus {
background: black;
}
#main-menu-links a:active {
background: yellow;
}
#main-menu-links li a.active {
background: yellow;
}
.featured #main-menu-links li a:active,
.featured #main-menu-links li a.active {
background: yellow;
}
Thanks.
Comments
Please read this article here
Please read this article here. After that you should be able to debug the problem very easily on your own.
You simply have to find out, which style overrides the style for the active state.
I like cookies!
Don't hack core
It sounds like you are modifying the css files directly in the Bartik theme. This is a really bad idea that will result in all your changes being blown away when you update Drupal. You should create a sub-theme of Bartik (in other words use Bartik as a base theme) and then do your CSS customizations in your sub-theme.
css file
Thanks for the information and how the background colors are listed. Stryker Investigation Services (678) 601-6148