• Hi! I’ve been trying to build my own theme with WAMP. I used the _s starter theme and right now, I’m still trying to style my menu. I want to use font awesome for my dropdown menu. I should have an arrow or a chevron after the text. I was actually able to pull it off using the code below. However, I cannot style it for hovering. Is there a way I can do so? Also, is there another code I can use to integrate the icon right next to the text without using after or before? I also tried using a:hover:after and it works but only when I hover over the icon and not when I hover over the text. They should be together. I hope that makes sense.

    .nav-menu li li > a:after {
        color: #ADADAD;
        font-family: fontawesome;
        content: ' \f054';
    }
    
    .nav-menu li > a:only-child:after {
        content: '';
    }
Viewing 1 replies (of 1 total)
  • Thread Starter johannaellamay

    (@johannaellamay)

    I have a benchmark website and when I try to inspect element, the menu item that has a dropdown appears to have another element as follows:

    <li id="menu-item-123" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-has-children menu-item-children-1"><a href="https://example.com/contact/">CONTACT<span class="sf-sub-indicator"></span></a>

    Inside the anchor, there’s a span. I also wish to add a similar element or even <i> so I can add a fontawesome icon after my menu item with a dropdown which should also be a child element to the list so when I hover over the list, I will also hover over the icon. Therefore, whatever style I apply to the list will also apply to the icon.

Viewing 1 replies (of 1 total)
  • The topic ‘Using Font Awesome for submenus (_s theme)’ is closed to new replies.