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.

Screenshot 2022 01 06 at 9.52.18 AM
Screenshot 2022 01 06 at 9.52.18 AM

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;
}
Screenshot 2022 01 06 at 9.52.18 AM
Screenshot 2022 01 06 at 9.52.18 AM

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

Top 5 Appointment Booking WordPress Plugins (2025 Edition)

Top 5 Appointment Booking WordPress Plugins (2025 Edition)

What to Look for in a Great Appointment Booking Plugin1. Calendar View and Availability Management2. Payment Integration3. Notifications and Reminders4. Google Calendar Sync5. Speed and Lightweight Design6. Ease of Setup and CustomizationTop 5 Appointment Booking...

Top 5 Free India Payment Gateways for your WordPress Website

Top 5 Free India Payment Gateways for your WordPress Website

Why Choosing the Right Payment Gateway MattersTop 5 Free Best Payment Gateways for WordPress in India (2025)RazorpayInstamojoPayPal IndiaStripeCashfree PaymentsComparison Table: Best Indian Payment Gateways for WordPress (2025)How to Integrate a Payment Gateway in...

Top 5 SEO plugins for WordPress Website

Top 5 SEO plugins for WordPress Website

What Makes a Good WordPress SEO Plugin?Top 5 SEO Plugins for WordPress (2025 Edition)1. Rank Math SEO (Best Overall Plugin)2. Yoast SEO (Most Popular & Beginner-Friendly)3. All-in-One SEO (Best for Businesses & WooCommerce)4. SEOPress (Best Lightweight SEO...

Top 10 SEO Friendly WordPress Theme

Top 10 SEO Friendly WordPress Theme

What Makes a WordPress Theme SEO-Friendly?Top 10 SEO Friendly WordPress Themes for 2025AstraGeneratePressKadenceOceanWPNeveSchema by MyThemeShopHello ElementorSydneyZakraBlocksyComparison Table - SEO Features at a GlanceFree vs Premium SEO WordPress ThemesHow to...

ChatGPT 5.2 Features and Breakthroughs You Need to Know

ChatGPT 5.2 Features and Breakthroughs You Need to Know

ChatGPT 5.2 vs 5.1: What’s New and Why It MattersThe Evolution Timeline: How We Got From 5.0 to 5.1 and Now to 5.2ChatGPT 5.0ChatGPT 5.1ChatGPT 5.2What ChatGPT 5.1 Introduced1. Dynamic Memory Layer2. Custom Experience Controls3. Better Code and Fact Handling4. Early...

Mayank Kumar is the Founder and CEO of Web Wallah. He is a Digital Growth Strategist who has scaled 100+ brands with SEO, high-performing websites, and ads delivering 6–8x ROAS. As a professional speaker and WordPress mentor, he also contribute as an organiser of the WordPress Delhi Community and the n8n India Community (Unofficial).

Latest Posts

WhatsApp