Making your site stand out from the crowd is sometimes easier said than done. Fortunately, you can get involved with DIY by adding creative customization touches that will ensure that your blog stands out from others.
In this tutorial, I will show you how to use the Divi builder to customize your blog, and in particular the CSS area.
This is the region I'm talking about:
What this means is that any changes we make here will only be effective on the page we are editing. This is an incredibly interesting and useful feature!
Here is the final result we will have at the end of this tutorial. The background color of the navigation menu that changes depending on the page you are visiting. As an additional option you will notice that the icons also change color.
I will first show how to apply the background color on the menu. Then separately I will show you how to make the social icons match.
If you have not yet read our tutorial on presentation of the theme WordPress Divi, I invite you to do it.
Let's start!
Apply colors to menus
First, I am using the default header format. If you are using another format, this tutorial should still be effective because the generic ID of "divs" on Divi is the same for all formats (# main-header), as far as I know. If you have problems with other formats.
We need to make sure the links appear on the bottom. The colors I chose, which you will find on Coolors.co if you want to use them, are on the darker side, so I have to make the text link a light color. I opted for the color white.
I am using rgba (255,255,255,0.6) which will be the link color and dark white as the active link color (for the desired visual effect)
Then go to the page on which you want to apply the first change (you should see the menu links in place). Click on the "3 line" icon and an options box will appear.
Now add the following CSS in this box:
# Main-header {background: #474f61; }
You should have something similar to this, don't forget to change the hex code to whatever color you want:
Click on " Save and update And this will apply to the main menu, all in one line of code.
Now you just need to add this same code for all your pages and change the hex code each time.
Social Network Icons (Optional)
For this part, we're going to modify the code we've already done, then add some code at the site's CSS level, and I'll explain why some CSS should be added in the individual pages and why some should not be 'to be.
So first you have to make sure that you have set up your social links. Go to " Divi Options> General theme And add your URLs to your social media pages.
Then go to your settings in the secondary menu bar and set the background and text colors. I'm choosing 'white' as the text color because I'm going to add a round colored background to each social icon to match with the new menu color, so that the icon can appear.
Go to " Header & Navigation> Header Elements And tick the box " Show social icons ».
Do you remember how we proceeded to add CSS on each page? We will go back and edit what we wrote before. Replace what you have there with the following CSS, or if you recognize what is different you can simply add the extra code.
# Main-header, # top-header .et-social-icon a {background: #474f61; }
This code will allow our site to not only change the background color for the menu on this page, but also the background of our social icons. We just added another element to the mix. You should have something that looks like the following:
You may need to check that hex colors are correct on each page.
General CSS
The following code will be in your " Theme option> CSS box Or in the style file of the child theme.
# Top-header .and-social-icons li {margin-left: 5px; } # Top-header .and-social-icon a {padding: 4px; Margin-bottom: 8px; Width: 30px; Height: 30px; Border-radius: 50%; Line-height: 24px; }
You may be wondering why this is not so in the CSS box of the page. The reason is that this particular piece of code affects all the targeted elements so it is inefficient to put the exact same code in multiple places. Only the background color changes per page, but this code does not change per page. It's just a best practice to avoid adding weight to your site.
That's all for this tutorial, I hope it will allow you to customize the menus on your WordPress blog.
[vc_row center_row=”yes”][vc_column width=”1/2″][vcex_button target=”blank” layout=”expanded” align=”center” font_family=”Raleway” font_weight=”700″ style=”flat” custom_background=”#18b69d” custom_hover_background=”#118d7a” custom_color=”#ffffff” custom_hover_color=”#ffffff” icon_right=”fa fa-download”]DOWNLOAD DIVI THEME [/vcex_button][/vc_column][vc_column width=” 1/2″][vcex_button url=”https://www.elegantthemes.com/affiliates/idevaffiliate.php?id=23065&url=40632&tid1=tutorials” target=”blank” layout=”expanded” align=”center” font_family =”Raleway” font_weight=”700″ style=”flat” custom_background=”#c4226e” custom_hover_background=”#8d184f” custom_color=”#ffffff” custom_hover_color=”#ffffff” icon_right=”fa fa-download”]DOWNLOAD THE TEMPLATES DIVI[/vcex_button][/vc_column][/vc_row]
Other Divi tutorials
- 5 websites for restaurant use Divi theme
- How to add text on a Divi WooCommerce product
- How to change the menu color between Divi pages
- How to personalize the grids of a blog with Divi
- How to use the role Divi editor on WordPress
- How to create a full screen Divi slider
- How to change the color of menus between Divi pages
- Features you probably do not know about Divi
- How to use Divi Builder on WordPress
- How to use the Divi video scrolling module
- How to use the Divi Builder Flip module
- How to add a testimonial module on Divi Builder
- How to use the Divi text module
- How to create a slider on Divi
- How to edit a Divi user role
- How to use the Divi Social Media module
- How to use the shop module on the theme WordPress Divi
- How to use the Divi sidebar module
- How to use the Divi Price Table Module
- How to use the title module of Divi publications
- How to add a video module of Divi
- How to use the article navigation module
- How to use the Divi search module
- How to use the Divi wallet module
- How to use the person module on Divi Builder
- How to use the wallet module with Divi filter
- How to use the full width slider module
- How to use the Divi Builder Image Module
- How to use the full-width navigation module of Divi Builder
- How to use the image gallery module
- How to use the Divi Builder Full-Width Card Module
- How to use the Divi Full Width Portfolio Module
- How to use the Divi full-width header module
- How to use the Divi Counter Module
- How to use the articles slider on Divi Builder
- How to use the Divi Email Optin module
Hello,
Thank you for all your tutorials.
Do you know if we can put the divi submenu (second level below the dropdown) in fill-width? which takes up the full width of the page
Hello,
How do you go about changing the color of the text in the main header? Having a transparent background (on my main-header), the font color I chose (on my main-header, which presents my different sections) via the divi customization interface is black. However I would like it to be white on SOME PAGES because the photo below is too dark.
How to do?
Thanks in advance,
Hello Germain,
Do you want it to be white on all pages or just a few pages?