How to give a NavWalker its own stylesheet?

Walkers don’t have associated stylesheets. That’s not how they work. You need to load them separately by enqueuing the stylesheet in the wp_enqueue_scripts hook, as you’ve done in load_css(). The walker class gets used by setting the walker argument of wp_nav_menu() to an instance of the class when you’re rendering the menu in a template. Since the class isn’t instantiated or used until the menu is rendered it can’t enqueue stylesheets in the header.

If the markup of your menu matches what you expect from the walker class, and you can see your stylesheet being loaded by a <link rel="stylesheet" /> tag in the header, then you’ve done everything correctly. If you’re still not getting the result you expect then the problem is likely with your CSS. It’s likely that the selector is incorrect, or its specificity is not sufficient to override existing styles.

techhipbettruvabetnorabahisbahis forumutaraftarium24edusedusedusedueduedueduseduseduedu