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

The Hidden Role Of Dedicated Servers In Your Favorite Apps & Websites

The Hidden Role Of Dedicated Servers In Your Favorite Apps & Websites

Whether you are watching a video, shopping, or talking with friends on social media, there’s a powerful engine working behind the scenes that helps reach the content on your browsers via the internet. Most probably, it’s the strength of the dedicated servers (Windows...

Hosting-Specific Landing Pages: Do They Convert Better?

Hosting-Specific Landing Pages: Do They Convert Better?

The web hosting industry is extremely competitive. Whether it is shared low-price hosting, VPS, or dedicated servers, having the best infrastructure won't guarantee success. The business still needs to encourage visitors to sign up. One tool that can greatly enhance...

Hostinger vs Bluehost: Our Feedback after using for 6 months

Hostinger vs Bluehost: Our Feedback after using for 6 months

Bluehost and Hostinger entered the hosting industry around the same time—Bluehost in 2003 and Hostinger following closely in 2004. These two web hosting companies have evolved considerably over the last two decades. They provide easy usability, and offer free domain...

Step-by-Step Guide to Creating an ADA-Compliant WordPress Site

Step-by-Step Guide to Creating an ADA-Compliant WordPress Site

What is ADA Compliance & Why It Matters ADA-Compliant WordPress Site Imagine visiting a website and not being able to read the text or use the navigation menu. That’s what millions of people with disabilities experience every day. ADA compliance is about making...

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...

Mayank is the Founder and CEO of Web Wallah. Mayank is a Computer Science Geek, deeply passionate about WordPress, actively contributing to the community, and believing in the potential of open-source tech to create a better world.

Latest Posts