Create a Floating Header in Flatsome Theme

Learn how to create a stylish floating boxed header in Flatsome with just native theme options and custom CSS—perfect for a clean, modern website look!

 •


A website’s header is a critical element for user navigation and overall experience. A floating header—also called a sticky header—stays visible at the top of the page as users scroll, ensuring that key information like menus, shopping carts, and promotions is always accessible. For WooCommerce stores, this small but impactful feature can improve navigation and boost conversions. With the versatile Flatsome theme, creating a floating header is both simple and rewarding.

What Is a Floating Header and Why Does It Matter

A floating header is a design element that remains fixed at the top of a webpage, regardless of how far a user scrolls. Unlike static headers that vanish as users move down the page, floating headers keep important features—like navigation menus or shopping carts—always visible, making the browsing experience more seamless.

For WooCommerce stores, a floating header can greatly enhance the shopping experience. By keeping navigation menus, search bars, and checkout buttons always within reach, it ensures users have seamless access to essential features. This improved accessibility reduces friction, encouraging better engagement and higher sales conversions. When customers can easily find what they need or quickly proceed to checkout, they’re far more likely to complete their purchase.

Flatsome theme users can utilize floating headers to improve their site’s usability. For example, you can promote ongoing sales or discounts with eye-catching banners, keep the cart icon always visible for quick access, or highlight customer support contact details. These enhancements create a more intuitive and user-friendly experience, making it easier for visitors to navigate your site and engage with key features.

Step-by-Step Guide to Creating a Floating Header in Flatsome

Step 1: Set the Background Color for Content

First, we need to set a background color for the content so the floating header stands out.

  1. Go to your WordPress dashboard.
  2. Navigate to Flatsome > Theme Options > Layout.
  3. In the layout section, choose a background color. Paste your preferred color code.
  4. Click Publish to save your changes.

Now your website should have a consistent background color across the page, which will help the floating header stand out.

Step 2: Make the Header Transparent

Next, we’ll remove the default header background to create the floating effect.

  1. Go to Theme Options > Header > Header Main.
  2. Under Background Color, drag the transparency slider all the way down to make the header fully transparent.
  3. Click Publish to apply the changes.

Step 3: Remove the Header Divider

Flatsome adds a divider beneath the header by default, but we need to remove it for a cleaner look.

  1. Stay in the Header Main settings.
  2. Locate the Header Divider option and uncheck the box to disable it.
  3. Publish your changes.

Step 4: Add Custom CSS for Floating Boxed Header

Now, let’s add some custom CSS to style the header as a floating box.

  1. Install and activate a plugin like WP Code for easy CSS management (or use the built-in Flatsome Custom CSS feature).
  2. Create a new CSS file or go to Flatsome > Theme Options > Advanced > Custom CSS.
  3. Paste the following code:
/* Floating header styling */
.header-inner.container {
    margin-top:30px;
    max-width: 950px;
    border-radius: 20px;
    padding: 0px 30px;
    background: rgba(255,255,255,.54);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
}
/* Header padding for Mobile + Tablet */
.header-main  {
    padding: 0px 15px;
}
/* Remove header shadow */
.header-wrapper.stuck, .header-shadow .header-wrapper, .layout-shadow #wrapper {
    -webkit-box-shadow: none;
    box-shadow: none;
}
  1. Save the changes and refresh your website to see the new floating boxed header in action.

Step 5: Fine-Tuning and Adjustments

  • Margin Top: This keeps space between the top of your site and the floating header. If you use a top bar, adjust accordingly.
  • Max Width: Modify based on the size of your navigation items. A smaller width makes the header look more compact.
  • Border Radius and Background Color: Customize the roundness and color to fit your website’s style.
  • Padding: Ensure the header looks great on all devices, including mobile and tablet.

A floating header can significantly enhance the user experience on your Flatsome-powered website by ensuring navigation is always intuitive and accessible. With a few simple steps, you can create a sleek, functional floating header that not only improves usability but also drives higher conversions for your store.

For more tips and tutorials on optimizing your WooCommerce site, visit Seb de la Web and take your website design to the next level.

Continue learning

flatsome designs

200+ Free Designs

Get for free

Need a custom design? Hire Seb today

Get the #1 All In One Design Agency for Flatsome

Hire Seb & Tas