Site logo

Archived topic

.menu-item-float-right CSS class not working on 3.0

6 replies · Started by Phil on September 9, 2020

Viewing posts 1–7 of 7

Hi. Having lots of fun playing with version 3.0 - great job!

I don't think the .menu-item-float-right CSS class is working on this version. When I apply it to primary menu items they don't change position. I also tried adding the following CSS in case it had been removed but that didn't work either:

.sf-menu>li.menu-item-float-right {
float: right!important;
}

Thanks,
Phil

Hi Phil,

CSS float property doesn't work on elements with display:flex;.

I believe you're trying to right align your navigation menu.

Perhaps we can try a different approach?

You can try adding this code:

.main-nav {
    margin-left: auto;
}

This will automatically add left margin that'll push your nav menu so it'll appear right aligned.

Let us know if it works for you.

Thanks Elvin and Tom, much appreciated :)

Glad we could help! :)

add_action( 'generate_menu_bar_items', function() {
    ?>
    <span class="menu-bar-item">
        <a href="URL HERE">Floated menu item</a>
    </span>
    <?php
} );

Where do I add this code snippet? I'm a relative beginner with WP and using GeneratePress/Dispatch. I want to move the social media icons next to the search icon.

Current Menu Bar

This archived topic is closed to new replies.