Site logo

[Support request] How to add a hover underline in primary navigation.

Home Forums Support [Support request] How to add a hover underline in primary navigation.

Home Forums Support How to add a hover underline in primary navigation.

  • This topic has 1 reply, 2 voices, and was last updated 5 years ago by Elvin.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #1710243
    Dipak Singh

    Hello Tom, I want to add an underline when hovering primary menu links.
    I have been using this CSS

    .main-navigation .menu > .menu-item > a::after {
    content: “”;
    position: absolute;
    right: 0;
    left: 50%;
    bottom: 15px;
    -webkit-transform: translateX(-50%);
    transform: translateX(-50%);

    display: block;
    width: 0;
    height: 2px;

    background-color: currentColor;
    transition: 0.3s width ease;
    }
    .main-navigation .menu > .menu-item.current-menu-item > a::after,
    .main-navigation .menu > .menu-item > a:hover::after {
    width: 50%;
    }

    But I want to hover above the links like this site primary menu links hovering
    https://www.theminimalists.com/

    please suggest what I do to make this

    #1710263
    Elvin
    Staff
    Customer Support

    Hi there,

    Try this CSS:

    .main-navigation .menu > .menu-item > a:hover{
    border-top: 1px solid transparent;
    border-color: #000;
    font-size: 12px;
    margin: -1px 6.5px 0 6.5px;
    padding: 18px 0 17px 0;
    }
Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.