WordPress.org

Forums

BlackBird
add dividers between nav menu items (6 posts)

  1. abir759
    Member
    Posted 11 months ago #

    I am a starter in wordpress. my web url is http://www.drdalise.com/.
    I want to add dividers between nav menu items.Anybody can please help me to figure it out..
    Thanks

  2. smdaymeansnever
    Member
    Posted 11 months ago #

    You can accomplish this with a little CSS. Add or modify this in your stylesheet:

    ul.menu > li:after {
    	content: "/";
    }
    
    ul.menu > li:last-child:after {
    	display: none;
    }

    This will add a / to each list item with the class "menu" except for the last item. Of course, you can use a different character.

    Another way that might look interesting:

    ul.menu > li {
            border-right: 1px red;
    }
    
    ul.menu > li:last-child {
            border: none;
    }
  3. esmi
    Forum Moderator
    Posted 11 months ago #

    @smdaymeansnever:Thank you contributing to the forums but please do not encourage people to edit theme files directly. At best, they will lose all of their changes when they update the theme. At worst, they could bring their site down. They should be recommended to create a child theme or use a custom CSS plugin for their changes.

  4. abir759
    Member
    Posted 11 months ago #

    Thanks smdaymeansnever its work for me.! I also got another code for doing this,

    I simply add
    boreder-right:1px soild; in menu section of style.css

    Thanks a lot esmi for support
    :)

  5. smdaymeansnever
    Member
    Posted 11 months ago #

    @esmi, you're absolutely right. I'll remember to reference the child themes in the future since beginners are more likely to be jumping right in and making those changes to their parent theme. Thanks for the reminder!

  6. esmi
    Forum Moderator
    Posted 11 months ago #

    No problem :-)

Reply

You must log in to post.

About this Theme

About this Topic