WordPress 5.7, Theme 2021.
1 How do you change the colour of the submenu items in the Main Menu?
I’m a WordPress newbie, basic/intermediate knowledge of CSS.
2 How do I change the background colour of the main menu and submenu?
This additional CSS makes the main menu items white. I want to do the same to the submenus.
*start of menu */
/*menu background */
.menu-wrapper {
background: rgba(204,153,51,.75);
}
a#primary-menu-list {
color:white;
}
.primary-navigation .primary-menu-container > ul > .menu-item > a
{color:white;}
.svg-icon
{color:white;}
/*end of menu */
2
Answers
Attempt 1: I failed with the CSS, but then looked carefully in:
Plugin: Options for Twenty Twenty-One (free version) Customising Nav Options
set Nav Background Color: selected the relevant color
Attempt 2: Without the plugin
This works well when I use the + key to trigger the drop down If I click on the submenu heading the heading is hard to read (white text on whitish background).
Additional CSS
As this theme supports CSS variables right now – I’d suggest you not override selectors, but override just variables. You need to add to your CSS these lines, replace with the colors you really want to use and make sure they override default styles
Here’s the list of available variables for the main navigation