How to Create a Scroll Container for Your Divi Comments Module

Last Updated on January 13, 2023 by 4 Comments

How to Create a Scroll Container for Your Divi Comments Module
Blog / Divi Resources / How to Create a Scroll Container for Your Divi Comments Module
Play Button

The comments section of a blog post allows readers to engage with others. It also allows users to be able to create conversations with people who are ingesting your comment. For those special posts that drum up a lot of noise, the comments section can get pretty hectic! You may want to find a way to make a long comments section easier to navigate. Consider creating scrollable comments in Divi!

By creating a scroll container for your Divi Comments Module, you can minimize the amount of scrolling readers of your blog need to undergo. Thus, they have a better experience with your site. Itโ€™s important to consider factors of user experience when you are building your site, and by adding a scrollable comment in Divi youโ€™re making your readers have an easier time enjoying your site which is always a good thing.

Subscribe To Our Youtube Channel

Why Comments Are a Good Thing

Before we head into the tutorial, letโ€™s take a quick look at comments in general. In Divi, we have a Comments Module. This module allows users of your site to leave a comment on a page or post. The module also allows people to read past comments that have been left behind on a post by other readers of your site. When a post is engaging, it can encourage people to want to leave their thoughts, opinions, and questions with the author (a.k.a you) under the post. This is an example of what that looks like from the Elegant Themes blog:

A sample of the Elegant Themes comments section

This is the comments section on the 3 Best Voice Search Plugins for WordPress post on our blog. In it, you can see that several readers have left feedback, thanks, and more. The postโ€™s author has also taken the time to respond to readers. This kind of engagement is good for your blog and website because it shows that you are providing value to you readers. In addition, it helps you build a stronger bond with those who use and visit your site. Now that weโ€™ve seen comments in the wild, letโ€™s see how we can manage the comments section in our own blog posts using Diviโ€™s Comments Module.

Scrollable Comments in Divi: An Overview

For this tutorial, weโ€™ll be using the Blog Post Template from Diviโ€™s Software Layout Pack. Hereโ€™s a quick overview of the template:

The Software Blog Post Template... Very long!

Notice how there are a few comments on this post? We can make this part of our blog page easier to navigate by adding a vertical scrollbar. For this tutorial, weโ€™ll be adding a vertical scrollbar to the row that is holding the Comment Module. Then, weโ€™ll use a little bit of CSS to style said scrollbar so it looks different than the main scrollbar for the page. Ready? Letโ€™s get into it!

Scrollable Comments in Divi: The Tutorial

Before we get started on creating scrollable comments in Divi with the Comments Module, youโ€™re going to need to install the Software Blog Post Template. Follow the instructions within that blog post to install your Blog Post Template.

Enter the Comments Row Settings

Once your template is installed and edited to your satisfaction, weโ€™re going to enter into the row that is holding the Comments Module. Scroll down to the section that contains the Comments Module. Hover over the row (green outline), and click on the gear icon. This will open up the settings module for the row.

Enter the row settings

Set Row Max Height

Before we begin styling or activating the scrolling, we need to adjust the max height for the row. To do this, we click on the Design tab. Next, we click on the Sizing tab. We then enter a Max Height of 550px to the Max Height option.

Adding max height to row

Enter Row Advanced Settings

After setting the max height of the row, weโ€™re going to click on the Advanced tab within the modal box. It is here that the scrolling magic happens! Take note of the Vertical Overflow option which is further down the Advanced tab. Weโ€™ll be coming back to that soon.

Enter the Advanced tab within the row settings modal box

Activate the Vertical Scrollbar with Vertical Overflow

Scroll down util you arrive at Vertical Overflow. Click on the dropdown and select Scroll.

Activate vertical scrollbars by setting the Vertical Overflow to Scroll

While we have our vertical scrollbar, we can spruce it up a bit with some almighty CSS and padding.

Adding Padding to Prevent Overlap

To prevent our newly added scrollbar from overlapping with our buttons within our comments section, weโ€™re going to add some padding to the right and left-hand sides of our row. To do this, navigate to the Design tab of the Row Settings modal. Next, scroll down to Spacing. Click the link icon between the Left and Right Padding text boxes. Weโ€™re going to add a padding of 55px to each side of the row.

Adding padding to row to prevent scrollbar from overlapping over Comments Module

Since weโ€™ve added some breathing space to our scrollbar, letโ€™s now make it pretty with some custom CSS.

Add a CSS ID to the Row

Moving back to the Advanced tab of the row, scroll to the top. Add your CSS ID โ€“ for this tutorial, weโ€™ll be using scrollie โ€“ that weโ€™ll be calling within the Custom CSS section in the Body Template Settings.

Add CSS ID to row to prepare for styling scrollable comments in Divi

Add Custom CSS to Style Scrollbars

Now, weโ€™ll be entering into the Custom CSS for our Blog Post Template. This will ensure that our CSS will be active on each blog post within our website as this template is applied to All Blog Posts within the Divi Theme Builder. To enter the Custom CSS setting for our body template, click on the three dots within the purple button in the bottom center of the builder. Next, select the gear icon.

Entering page settings for Custom CSS

Add Custom CSS to Style Scrollable Comments in Divi

We want to style the scrollbar for our scroll container to differentiate itโ€™s use from the main scrollbars of our browsers window. To do this, weโ€™ll be using some CSS. Once you are within the Body Template Settings, select the Advanced Tab. Next, scroll down to the Custom CSS tab.

Entering the Advanced section of the Body Page Template

Once weโ€™re in the Custom CSS section of the Body Page Template, copy and paste the following CSS code:

/* Custom Scrollbar CSS */
/* Firefox */
#scrollie {
scrollbar-width: auto;
scrollbar-color: #000000 #ffffff;
}

/* Chrome, Edge, and Safari */
#scrollie::-webkit-scrollbar {
width: 16px;
}

#scrollie::-webkit-scrollbar-track {
background: #ffffff;
}

#scrollie::-webkit-scrollbar-thumb {
background-color: #000000;
border-radius: 0px;
border: 3px solid #ffffff;
}

Custom CSS for scrollable comments in Divi

If you used a different CSS ID, ensure that youโ€™ve updated the code snippet within your website to reflect this. You can edit the CSS or add to it to style your borders in a way that matches your brand and website. In our case, we went with a flat design to match the styling of the Divi Software Layout Pack.

Save Your Blog Post Template

Once youโ€™re happy with your CSS edits, remember to save your Blog Page Template. Click on the green Save button on the bottom right-hand side of the bottom menu within the Divi Theme Builder.

Save your work!

Once your settings are saved, visit your newly updated comments section on your blog!

Styled scrollable comments in Divi

Scrollable Comments in Divi: The Conclusion

Creating a scroll container for Your Divi Comments Module helps your users to have a better experience with your comments section. User engagement is an important factor to nurture within your blog. By making your Comments Module scrollable, you are providing ease of use for your readers when they come to enjoy your various blog posts.

Divi Cyber-monday Sale

It's The Divi Cyber Monday Sale! Save Big For A Limited Time ๐Ÿ‘‡

Save big on Divi and Divi products for a limited time.

Access The Sale
Divi Cyber-monday
Premade Layouts

Check Out These Related Posts

Divi 5 Update: Public Alpha Version 4

Divi 5 Update: Public Alpha Version 4

Posted on November 25, 2024 in Divi Resources

The Divi 5 Public Alpha is available for testing. If you use Divi 5, you’ll notice an update notification for Public Alpha Version 4 today. We release new Divi 5 versions every two weeks, and it gets better each time! If you haven’t tested Divi 5 yet, try it and let us know what you...

View Full Post
New Starter Site for Freelancers (Quick Install)

New Starter Site for Freelancers (Quick Install)

Posted on November 24, 2024 in Divi Resources

Divi empowers you to build the best websites possible, and now, Divi Quick Sites takes website creation to a whole new level. This revolutionary tool lets anyone, regardless of skill level, generate a complete website in under two minutes! Divi Quick Sites provides everything you need to launch...

View Full Post

4 Comments

  1. Very cool, but in your screenshots this has also added a horizontal scroll โ€” presumably due to the padding?

    • I believe once the tutorial is complete and one moves to the frontend (outside of the builder), only the vertical scrollbar appears. However, I think that with the horizontal overflow settings, if the horizontal bar does appear, it could be hidden.

  2. Dope cool feature. Divi is so amazing

    • Yup, Divi is pretty awesome ๐Ÿ™‚

Leave A Reply

Comments are reviewed and must adhere to our comments policy.

๐Ÿ‘‹ It's The Divi
Cyber Monday Sale!
Get The Deal
Before It's Gone!
Join To Download Today