Normally, website navigation is displayed on top and disappears when users scroll down. Fixed/sticky navigation menu remains visible and in the same position as the users scroll down and move about a site.
If you want the same on your website, just add the following CSS and JavaScript to your Divi Website.
If you want to display fixed header on the specific pages, use Divi 4.0 conditional logic and insert the divi code module below the menu module and paste the JavaScript snippet. You can do that too with CSS by wrapping the code in the <style> </style> tags or simply paste it into the Custom CSS tab.
Does this snippet (still) work?
Please let us know in the comments if everything worked as expected. We have tested this code with the Version: 4.0.1 of the Divi Theme and Divi Friendly Hosting with PHP 7.3.
If you think this code saved you time, we will be happy to receive a comment! 🙂
____
License: This snippet contains code from the Divi Theme, copyright https://elegantthemes.com, modified by Divi Space, October 22, 2019. Licensed under the GNU General Public License, no warranty; click here for details.
I want to be able to do this exact thing, but only with a mobile header. How do I do that?
Hi Spencer, just change the media query width value. (CSS code, line 6)
“@media only screen and ( min-width: 480px ) ”
For tablet and below :
@media only screen and (max-width: 980px)
For phone:
@media only screen and (max-width: 767px)