woocommerce. Can't remove active item square around navigation menu

I'm working on a university/personal project using WooCommerce for my website TriDice, and I'm trying to remove the focus outline (active item square) that appears around the navigation menu items, logo, and shopping cart when clicked. I've encountered this issue before on another project and managed to find an option in the WooCommerce block settings UI to disable it, but I can't seem to locate it this time. I’ve tried using CSS but haven’t had any success. Here's what I’ve tried so far: css nav a, nav a:focus, nav a:active { outline: none; border: none; } #logo, #logo:focus, #logo:active { outline: none; border: none; } #shopping-cart, #shopping-cart:focus, #shopping-cart:active { outline: none; border: none; } This didn’t work for me. Is there something I’m missing, or is there another method to disable the focus outline in WooCommerce or WordPress block settings? Any help would be greatly appreciated! Details: Using WooCommerce with WordPress. The focus outline appears on navigation menu items, the site logo, and the shopping cart icon. I’d prefer a CSS solution but am open to options in the block editor if applicable. This format follows Stack Overflow standards: it clearly outlines the problem, includes what you've already tried, and is specific about the environment you're working in.

Comment (1)

Jese Leos

October 1, 2024

Verified user

Try making a more specific rule, not on all <a> tags but on a specific one For example this snippet removes an outline from logo: button.wc-block-mini-cart__button { outline: unset !important; } Otherwise if you can remove this rule from the html: :root :where(.wp-block-group a:where(:not(.wp-element-button))) {color: #ffd700;} It appears to be automatically generated by the Wordpress theme.

You’ll be in good company