Skip to main content

Sticky Header Overlaps Anchor in Elementor Page Builder Wordpress

Elementor's anchor widget is fantastic tool for creating internal link to jumps on your webpage, perfect for one-page website.
However, used together with a fixed header or sticky navigation, this can be a problem.  When an anchor link is clicked, the fixed header might block the content you're trying to scroll to.  This blog will show you how to fix that.

Adding Elementors Anchor Widget

For this article, this is how our Elementor anchor widget is implemented. We just add it above the headline or Title  that we want the visitor to scroll.

This is how the Anchor widget is implemented in Elementor.
This is how the Anchor widget is implemented in Elementor.

Problem: Sticky Header Overlaps Anchor

Let’s have a quick look at what we are presented with when making no adjustments and simply try to use a sticky navigation with Elementor anchor widget. Here is what we get by default.


Solution: A few simple lines of CSS

Here are two ways to add the CSS code to fix your anchor widget and sticky header:

  • Child Theme's style.css file: This option applies the fix to all anchor widgets on your entire website.
  • WordPress Customizer > Additional CSS: This is also a great option for applying the fix globally.


body:not(.elementor-editor-active) .elementor-widget-menu-anchor {
   position: relative;
   z-index: -1;
 }
 body:not(.elementor-editor-active) .elementor-menu-anchor:before {
   content: "";
   display: block;
   height: 100px; // fixed header height
   margin: -100px 0 0; // negative fixed header height
   visibility: hidden;
   pointer-events: none;
 }

Make sure to play with the height/margin values above until it suits your needs. Just make sure you keep the same values (eg, height at 100px and margin at -100px). This is how things look like with the CSS snippet applied.
And that’s it! This will fix the overlapping sticky header when using anchor widgets with Elementor.

Comments

Popular posts from this blog

How to Remove / Disable Billing Address Fields in Woocommerce

At times, there may be a need to eliminate or deactivate billing address fields during the checkout process. The approach for doing this will vary depending on your store type and your specific objectives. If you sell shipped products and you don’t need customer to enter a separate billing address, you can use the built in WooCommerce address features.  In WordPress admin, go to WooCommerce > Settings Click the Shipping tab Click ‘Shipping options’ Select ‘Force shipping to customer billing address’ for ‘Shipping destination’ and save. (Optional) Change the address heading.  By default, the heading for the address fields will be ‘Billing and Shipping address’. You can override this with this snippet: <?php // Do NOT include the opening php tag. // Place in your theme's functions.php file add_filter( 'cfw_billing_shipping_address_heading', function( $heading ) {    return 'Shipping address'; } );

How to Save Contact Form 7 Entries in Your WordPress Backend

Contact Form 7 is a fantastic, free plugin that makes it super easy to create and manage contact forms on your WordPress website. You can whip up simple or complex forms in minutes, making it a go-to solution for many website owners. However, one of the default behaviors of Contact Form 7 is that it primarily sends form submissions to your designated email address. While this is essential, what happens if an email gets lost in spam, or you simply want a centralized place to manage all your inquiries? That's where saving Contact Form 7 entries directly in your WordPress backend comes in handy! Having these submissions stored within your WordPress database ensures you never miss a potential lead or important message. So, how do you achieve this? Thankfully, there are excellent plugins that seamlessly integrate with Contact Form 7 to provide this functionality. Let's explore a couple of popular options: Option 1: The Simplicity of Flamingo Developed by the same team behind Contact...

Tutorial : How To Convert PDF To Google Sheets [Easy]

In Today Digital Age, Whether You're student, a professional, or a business owner, you'll often find yourself needing to convert data from one format to another. One Most Common challenge is Converting PDF files into Google Sheets. In This Article  We comprehensive guide on how to convert PDF to Google Sheets efficiently and effectively. let's explore the various methods for converting your PDF files into Google Sheets. Convert PDF To Google Sheets Method 1: Using Google Drive Upload your PDF: Sign in to your Google Drive account, click the "+ New" button, and choose "File upload." Select your PDF file. Right-click the PDF: Once uploaded, right-click on the PDF file, choose "Open with," and select "Google Sheets." Review and adjust: Google Sheets will attempt to convert your PDF into a spreadsheet. Review the results and make any necessary adjustments. Save your work: Finally, save your converted file by clicking "File" ...