[Support request] Help add vertical line | between primary navigation menu items

Home Forums Support [Support request] Help add vertical line | between primary navigation menu items

Home Forums Support Help add vertical line | between primary navigation menu items

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #2327775
    Shaun

    Hi
    I want to add a vertical line between primary menu items. How can I do this?

    • I don’t want a line before the first menu item or after the last one
    • I want to be able to specify the colour
    • I want to be able to adjust the padding

    Thanks
    Shaun

    #2327784
    Ying
    Staff
    Customer Support

    Hi there,

    Try this:

    .main-navigation .main-nav > ul > li:not(:first-child) {
        border-left: 2px solid white;
    }
    #2327812
    Shaun

    Thx Ying

    #2327821
    Shaun

    Can I reduce the height of the border to something like 50% vertically centred?

    #2327825
    Fernando
    Customer Support

    Hi Shaun,

    You can try this CSS instead:

    .main-navigation .main-nav > ul > li:not(:first-child) :before {
        content: "";
        position: absolute;
        left: 0;
        top: 50%;
        height: 50%;
        transform:translateY(-50%);
        background-color: #fff;
        width: 2px;
        z-index: 999;
    }
    
    .main-navigation .main-nav > ul > li:not(:first-child) {
        position: relative;
    }
Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.