• Good day.
    Is it possible to add a title attribute to individual items in the primary menu?
    Example: I have the abbreviation IH in the menu and I want “I’m here” to appear when I approach “IH”.
    Thank you

Viewing 3 replies - 1 through 3 (of 3 total)
  • Hi @wpuzivatel

    You can try it through CSS. For instance:

    li.menu-item:hover a {
        display:none;
    }
    
    li.menu-item:hover:after {
        display:inline;
        width:100%;
        height:100%;
        position:static;
    }

    Then add a rule like this for each menu-item you have.

    li#menu-item-390172:hover:after {
        content: ‘Im here’;
    }

    Replace menu-item-390172 with the id of each menu item.

    I find that it works best when the content is longer than the abbreviation.

    Hope this helps! ??

    Thread Starter wpuzivatel

    (@wpuzivatel)

    Hi. Thank you for an interesting solution. In style.css (child theme) I used only this part:

    li#menu-item-390172:hover:after {
        content: ‘Im here’;}

    the rest is not needed – it works

    You’re welcome @wpuzivatel! Glad to be of assistance! ??

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Add title attribute to primary menu?’ is closed to new replies.