Site logo

Archived topic

How to reduce the gap between nav bar social icon

16 replies · Started by Rohan Verma on June 1, 2020

Viewing posts 1–15 of 17

Hello any help

Hi there,

This might take a little bit of tweaking and a couple of attempts.

Can you first remove all the menu-item-float-right class added to each icon?

Then add a class custom-float-right to the Telegram icon.

Then I will attempt some CSS.

Let me know :)

Hello, I have added what you said, now please provide the css to move them to the right side near search and reduce the gap between the icons.

Thanks

Are the social icons in the order you wanted?

If so please add the custom-float-right to the Facebook icon/or the first icon in the list.

Not working safter applying the icons still stays like before.and how to reduce the gap between the icons without effecting the other menus

That's because I haven't provided the CSS yet.

- Remove the custom-float-right classes added to the LinkedIn icon.

- Add narrow-padding as a custom class to all the icons.

- Add this CSS:

@media (min-width: 769px) {
    .main-navigation ul.menu {
        display: flex;
    }
    .main-navigation ul.menu li.custom-float-right {
        margin-left: auto;
    }
    .main-navigation .main-nav ul li.narrow-padding a {
        padding-left: 20px;
        padding-right: 20px;
    }
}

Adding CSS: https://docs.generatepress.com/article/adding-css/

Working.Now how to reduce the gap between the icons and on mobile how they show up in a horizontal line

Awesome thanks dear now it looks good. Only one thing left menu icons in horizontal line on mobile devices

Try this:

@media (max-width: 768px) {
    .main-navigation.toggled .main-nav li.narrow-padding {
        float: left !important;
        display: inline-block !important;
        clear: none;
    }
}
This archived topic is closed to new replies.