[Support request] Underline above and below

Home Forums Support [Support request] Underline above and below

Home Forums Support Underline above and below

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #826977
    powerwebdomain

    Hello

    I am using this code:
    https://docs.generatepress.com/article/adding-menu-hover-animation/

    It works great.

    But I also want to havee the menu item line above ( 2 lines, one above and the other below the item)
    How could it be possible?

    Thanks.

    #827201
    David
    Staff
    Customer Support

    Hi there,

    try this:

    @media (min-width: 769px) {
        .main-navigation .menu > .menu-item > a::after, 
        .main-navigation .menu > .menu-item > a::before {
            content: "";
            position: absolute;
            right: 0;
            left: 50%;
    
            -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 > a::after {
             bottom: 0; /* Adjust bottom bar v.pos */
         }
         .main-navigation .menu > .menu-item > a::before {
             top: 0; /* adjust top bar v.pos */
         }
        .main-navigation .menu > .menu-item.current-menu-item > a::after,
        .main-navigation .menu > .menu-item.current-menu-ancestor > a::after,
        .main-navigation .menu > .menu-item > a:hover::after,
        .main-navigation .menu > .menu-item.current-menu-item > a::before,
        .main-navigation .menu > .menu-item.current-menu-ancestor > a::before,
        .main-navigation .menu > .menu-item > a:hover::before {
            width: 50%;
        }
    }
Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.