How To Add Vertical Divider Lines Between Menu Items In Divi

by | Jan 6, 2022 | Divi Tutorials

The first snippet here will apply to the Divi Menu module, so you probably will want to be using this in a header template in the amazing Theme Builder.

Using More Than One Menu Module

You don’t need to add any class to the module since we are targeting it, but if you want this effect to only apply to one menu module on your site, then replace the .et_pb_menu with your own CSS class and add that to the module’s CSS field in the advanced tab.

Copy the code snippet below and paste it in the Divi>Theme Options>Custom CSS box.

/*add borders to the menu items*/

.et_pb_menu nav > ul > li:not(:last-child) {
  border-right: 1px solid #000000;
}


/*adjust spacing around menu items*/

.et_pb_menu li a {
  padding: 4px 20px;
}

Add Vertical Dividers To The Default Divi Menu

Even though I totally recommend using the new Divi Theme Builder and Menu module, I haven’t forgotten those of you who are still using the default header. The snippet is very similar to the one above, except the CSS property is targeting the default menu instead of the Menu module. The step here is exactly the same. Copy the code snippet below and paste it in the Divi>Theme Options>Custom CSS box.

/*add borders to the menu items*/

#top-menu li:not(:last-child) {
  border-right: 1px solid #000000;
  margin-bottom: 20px;
}


/*adjust spacing around menu items*/

#et-top-navigation nav > ul > li > a {
  padding-bottom: 4px!important;
  padding-left: 20px;
}

Now you have vertical divider lines in your Divi menu! You can change the color of your divider by replacing with your colour code in the snippets.

The Bottom Line

You may need to play around with the spacing in the snippets to fit your website. For example, you may need to change the margin and padding values to something that works better for your situation. Other than that, you should be good to go! Be sure to change the colours according to your website pattern.

Latest Posts

Overview of the WordPress Interactivity API

Overview of the WordPress Interactivity API

The WordPress Interactivity API is a groundbreaking feature introduced in WordPress 6.5, designed to simplify and standardize the process of adding interactive elements to WordPress websites. This comprehensive guide will walk you through what the Interactivity API...

Power Of Gutenberg And Its Plug-ins For Enhanced Content Creation

Power Of Gutenberg And Its Plug-ins For Enhanced Content Creation

In the ever changing landscape of website development, there are several frameworks and runtime environments available for creating and testing websites. PHP, HTML, Node.js etc. WordPress is a popular CMS that has built an ecosystem around it to make web development...

How Do I Earn Money From Reseller Hosting? The Major Benefits

How Do I Earn Money From Reseller Hosting? The Major Benefits

Do you have the dream of building your own web hosting company? Of course, you might have. However, you may have concerns about building your web hosting company from scratch. Thus, reseller hosting services come into existence. In reseller hosting, you are able to...

Dedicated Hosting: The Key To Optimal Performance And Scalability

Dedicated Hosting: The Key To Optimal Performance And Scalability

In the web hosting world, dedicated hosting emerges as an alternative, offering customers an isolated, robust, and scalable hosting environment. As business owners and individuals are looking to enhance their online visibility and ensure the seamless working of their...

Contributor Day Registration For WordCamp Asia 2024

Contributor Day Registration For WordCamp Asia 2024

Greetings WordPress enthusiasts! As we gear up for the highly anticipated WordCamp Asia 2024, we are thrilled to share exciting news about a pivotal event that promises to elevate your WordPress experience – Contributor Day. Mark your calendars for March 7, 2024, at...

Our Founder Mayank is speaking at WordCamp Udaipur 2023

Our Founder Mayank is speaking at WordCamp Udaipur 2023

Who is Mayank? Mayank Kumar has been a WordPress enthusiast since he first used WordPress in 2020 when he was just 17 years old. Mayank is a 20-year-old Computer Science Geek who loves WordPress so much. He is been running a Web Agency and two Ed-tech...

How To Change Twitter Icon To X in Divi Theme

How To Change Twitter Icon To X in Divi Theme

As everyone knows, Twitter has changed its name to X. Websites and tools like Divi will definitely need some time to catch up, so I wanted to provide you with some quick instructions now so that those who wish to make changes can do so before it gets updated later in...

WordPress Dashboard – Comments

WordPress Dashboard – Comments

In the Comments Screen, you can edit or delete content found in comments to your posts, and you can mark comments as spam, send comments to the trash and reply to comments. A number of rules can be defined about who can write comments and how comments are...

WordPress Dashboard : Pages

WordPress Dashboard : Pages

The Pages Screen provides the facility to manage all the Pages in a blog. Via this Screen, Pages can be edited, deleted and viewed. Filtering and searching also make it easy to quickly find pages matching certain criteria. Several powerful features allow pages to be...

WordPress Dashboard : Media

WordPress Dashboard : Media

Media → Library Media consists of the images, video, recordings and files that you upload and use in your blog. Media is typically uploaded and inserted into the content when writing a Post or writing a Page. Note that the Uploading Setting in the Settings Media...

Latest Posts