0

I am trying to style one element of my navigation. To display the whole navigation I am using:

          <?php 
            wp_nav_menu( array(
                'theme_location' => 'menu-1',
                'menu_id'        => 'primary-menu',
            ) );
        ?>

It returns 4 main menu items. Only the last item should be positioned at the right. The rest should stay at the left. I checked the id of the desired item and tryed to style it separetly using:

li#menu-item-258.menu-item.menu-item-type-post_type.menu-item-object-page menu-item-258{color:red;}

For some reason it does not work. Any hints?

1 Answer 1

2

You can easily make the text of the last item right position with:

ul#nav li:last-child span {
   text-align: right;
}
2
  • In my case this also worked: li#menu-item-259 a{float:right;} li#menu-item-258 a{margin-left: 140px;} Jan 2, 2018 at 12:56
  • 1
    This is not the right method ! Jan 2, 2018 at 13:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.