How To Construct A Flexbox Header In Divi 5

by | May 21, 2026 | Etcetera | 0 comments

A header layout is a structural problem forward of this is a visual one. The logo, navigation, icons, and CTA want a clear relationship. You need to decide where every products sits, how so much house separates it, and what changes on smaller presentations.

Flexbox solves that problem with layout regulations. In Divi 5, those controls live throughout the Visual Builder, so that you’ll be capable of define the development visually as a substitute of writing custom designed CSS. Beneath, we will be able to assemble two smart Flexbox headers and show how Divi 5’s menu, canvas, and interaction apparatus art work together.

Table of Contents

Flexbox In Divi 5

Flexbox is a CSS layout sort for arranging items inside of a container. Items can take a seat down in a row, stack in a column, wrap, expand, shrink, and align.

In Divi 5, Flexbox is part of the core layout system. Sections, Rows, Columns, and Module Groups can act as flex packing containers. When an element turns right into a flex container, its direct children become flex items. That direct-child relationship problems in every single place this instructional.

Core Flexbox Controls

Divi 5 gives you visual controls for a very powerful Flexbox settings. You’ll set Construction Direction, Justify Content material subject material, Align Items, Construction Wrapping, Display Order, and Hollow values. The ones settings mean you can control building, spacing, and alignment without custom designed CSS.

The ones controls are responsive. A desktop row can become a cellular column, and items can change order at different breakpoints. That makes Flexbox excellent for headers because of a big navigation layout can change into a compact cellular header without reproduction sections.

Why Use Flexbox For Headers

Headers normally need one-dimensional layout control. Likelihood is that you’ll place a logo and menu in a row, or stack cellular menu items in a column. Flexbox handles those patterns smartly.

  • Use Display Order to reorder items on smaller presentations.
  • Use Align Items: Stretch when columns need an identical most sensible.
  • Use Expand To Fill when an products will have to use available house.
  • Use Shrink To Fit when an products will have to stay compact.
  • Use Hollow settings as a substitute of information padding between modules.
  • Use Construction Wrapping when items want to switch onto a brand spanking new line.

An important rule is discreet: Flexbox controls the direct children of a container. If quite a few modules will have to behave like one products, place them inside of a Module Team of workers. That makes sophisticated headers easier to regulate.

Additional Divi 5 Choices To Help You Assemble Upper Headers

Flexbox handles the layout, then again fashionable headers moreover need dynamic navigation, off-canvas menus, and world bettering. The ones Divi 5 choices help with that.

The Link And Dropdown Modules

A header without navigation is normally merely branding. Divi 5’s Hyperlink Module gives you a flexible building block for custom designed menus. You’ll create links manually or use Menu Loops to pull items from an provide WordPress menu.

Using Menu Loops

With Menu Loops, one Link Module can repeat for every products in a made up our minds on menu. The menu text and URL can come from dynamic content material subject material, which helps to keep your WordPress menu since the provide of truth. Add, remove, or reorder menu items in WordPress, and the looped navigation can exchange with it.

Using Dropdown Modules

The Dropdown Module builds on that system. Place a Dropdown Module inside of a father or mother section, similar to a Link Module, and Divi connects the dropdown behavior to that father or mother. The dropdown content material subject material house is flexible, so that you’ll be capable of add simple links, rows, footage, text, buttons, or whole mega menu layouts.

Use Dropdown Modules with care inside of looped menu items. A dropdown situated inside of a loop can repeat with every looped products. For simple menus, the standard Menu Module is still useful. Use Link and Dropdown modules when you need additional control.

Interactions And Canvases

A header regularly needs to show or quilt something. It is going to open a cellular menu, search panel, form, or promo modal. Building those elements inside of the primary header can litter the layout, so Canvases help keep them separate.

What Canvases Do

Each and every internet web page has a Main Canvas for the primary layout. Divi 5 moreover implies that you’ll be able to create detached Canvases, where a cellular menu, popup, slide-in panel, or staging house can live outdoor the primary internet web page building.

See also  Writing With Goal Have interaction, Convince, and Develop Your Buyer Base

Canvases will also be local or world. A space Canvas belongs to no less than one internet web page, while a Global Canvas will also be reused across the web page. That makes Global Canvases useful for cellular menus because of you’ll be capable of assemble the menu once and use it anyplace the global header turns out.

What Interactions Do

Interactions make detached elements interactive. You’ll add behavior throughout the builder without writing JavaScript. Choose a Purpose Event, similar to click on on, hover, scroll, or viewport get entry to. Then make a selection an Affect Movement, similar to showing or hiding an element. In spite of everything, make a selection the target section or container that receives the affect.

For headers, this is in particular useful. A hamburger icon can show a cellular menu Canvas, and a close icon can quilt it yet again.

Editable Theme Builder Areas

Headers don’t exist in isolation. They take a seat down above precise internet web page content material subject material, and that context problems. Logo measurement, spacing, difference, and sticky behavior are easier to judge when the internet web page is visible.

Editable Theme Builder Areas allow you to edit assigned headers, footers, body templates, and internet web page content material subject material in one front-end builder session.

That is serving to when building headers because of you’ll be capable of read about the header against the hero phase underneath it and alter spacing without leaving the internet web page.

Global template changes apply all over the place that template is assigned, so analysis every breakpoint forward of publishing.

Quicker than You Assemble: Plan The Header Building

Quicker than opening the Visual Builder, decide how the header will have to art work on desktop, tablet, and cellular. Flexbox makes layout changes easier, then again the assemble will however be cleaner if you already know which elements belong together and which ones will have to switch proper right into a Canvas.

Map The Header Portions

Get began by way of tick list every products the header needs. Most headers include a logo, navigation, CTA, social links, search, cart icon, contact details, or industry hours. Then decide which items are primary and which will also be secondary. Primary items will have to stay visible on desktop. Secondary items can switch into the cellular menu or disappear at smaller breakpoints.

  • Keep the logo visible on every breakpoint.
  • Keep the primary CTA visible on desktop when it is helping the internet web page goal.
  • Switch long navigation menus proper right into a cellular Canvas.
  • Switch contact details, hours, and social icons out of the compact cellular header.

Team of workers Items Quicker than Styling Them

Flexbox works on the direct children of a container, as a result of this building problems forward of styling. If a logo and menu will have to switch together, place them inside of a Module Team of workers. If 3 contact blurbs will have to stay together on the left facet of a row, place them inside of one group of workers. Then Flexbox can handle that group of workers as a single products.

  • Use Module Groups for similar header elements.
  • Use Rows or Columns as the primary flex packing containers.
  • Use Hollow settings for spacing between direct flex items.
  • Avoid the usage of padding as the primary spacing system between modules.

Plan The Mobile Behavior

The cellular header will have to not be a squeezed type of the desktop header. It will have to be a simpler layout with fewer visible items. A very good cellular development is a logo on one facet and a hamburger icon on the other. The entire navigation, CTA, and secondary links can live inside of a Global Canvas.

  • Use Display Order when items want a different cellular collection.
  • Use Visibility settings to hide desktop-only modules on cellular.
  • Use a Global Canvas when the identical cellular menu will have to appear sitewide.
  • Use Interactions to show and hide the cellular menu Canvas.

Check The Details Quicker than Publishing

Small header issues are easy to disregard because of headers appear on every internet web page. Check out the layout forward of publishing the global header.

  • Check desktop, tablet, and get in touch with breakpoints.
  • Check out widths between the default breakpoints.
  • Confirm dropdowns and Canvases take a seat down above internet web page content material subject material.
  • Set a clear Z Index for overlays, sticky headers, and dropdowns.
  • Be sure that hamburger and close icons have clear labels.
  • Check that menu links, CTA links, cart links, and social links art work.

Building A Flexbox Header In Divi 5

Now, let us assemble two headers from scratch. We will recreate two layouts from our unfastened 20 Header Design Pack: Design #11 and Design #12.

Divi 5 Flexbox header layout examples

Follow along step by step. You’ll moreover download the property from this weblog submit to get a faster get began.

Design #1: 3-Row Stacked Header

Some firms need more than a logo and navigation. Clinics, law puts of labor, companies, and local supplier providers regularly need contact details visible straight away. This layout uses a navigation row and a utility row. The appliance row holds contact information and a CTA.

Setting Up The Header In The Theme Builder

Transfer to Divi > Theme Builder in your WordPress dashboard. Click on on Add Global Header, then Assemble Global Header. The Visual Builder will open.

Open the phase settings forward of together with modules. Transfer to Design > Construction and set the Vertical Hollow to 0px. This helps to keep the header rows flush against every other.

Setting a 0px vertical gap on a Divi 5 header section

Next, transfer to Design > Spacing. Set the best possible and bottom padding to 0px. The outer phase stays compact, while every row can however control its non-public spacing.

Adding zero top and bottom padding to a Divi 5 header section

Together with The Header Rows

Get began with the default single-column row throughout the phase. This row will clutch the nested rows. Open the row settings and transfer to Design > Construction.

Set Construction Direction to Column, Justify Content material subject material to Get began, Align Items to Stretch, and Vertical Hollow to 0px. This stacks the nested rows vertically and helps to keep them edge-to-edge.

See also  How you can Promote Your WooCommerce Merchandise on Instagram

Set the row’s absolute best and bottom padding to 8px. Next, reproduction the development to create two stacked nested rows. The main row will clutch the logo, navigation, and social icons. The second row will clutch contact details and the CTA.

Duplicating a row structure in Divi 5

For the nested rows, set the Horizontal Hollow to 2% and the Vertical Hollow to 8px.

Setting horizontal and vertical gaps on a nested row in Divi 5

Follow the identical alignment just right judgment to the column throughout the first row. This makes the modules easier to align.

Rising The Two-Tone Background

Add a gradient background to the phase. Set each and every color stops to the identical degree. This creates a sharp transition as a substitute of a combined gradient. Use 50% for a just right get a divorce, or alter the prevent if one row is taller than the other.

Setting gradient colors and equal color stops for a Divi 5 header background

Building The Logo, Navigation, And Social Row

The main nested row has 3 parts: the logo, navigation, and social icons. Flexbox controls how those parts take a seat down together.

Together with The Logo And Navigation Team of workers

Add a Module Team of workers for the logo and navigation cluster. A group is useful because of Flexbox distributes direct children. When similar modules take a seat down inside of a host, the gang behaves as one flex products.

Inside the group of workers, set Construction Direction to Row, Horizontal Hollow to 2%, Justify Content material subject material to Get began, and Align Items to Heart.

Add an Image Module for the logo. As a substitute of uploading a static logo, use the Site Logo dynamic tag. This connects the header logo to Divi > Theme Alternatives > Customary, goodbye time period logo updates will also be handled from one place.

Applying the Site Logo dynamic tag to an Image Module in Divi 5

Together with The Navigation Links

Add a Link Module throughout the identical group of workers. Style the typography, spacing, and colors. Use Design Variables where possible so the menu stays in step with the rest of the web page.

Applying Design Variables to style a Link Module in Divi 5

Turn on the Loop Section toggle. Set the Query Sort to Menu, select the WordPress menu you need to turn, and set the loop order to apply the menu order.

Turning on the Loop Element toggle for a Link Module in Divi 5

Follow the Loop Menu Text dynamic tag to the Link Module label. Then apply the Loop Menu Link dynamic tag to the Link URL. The main controls the visible label. The second sends every products to the correct internet web page.

Applying the Loop Menu Text dynamic tag to a Link Module label in Divi 5

A Menu Module can assemble a simple navigation bar faster. Use a looped Link Module when you need additional control.

Together with Social Icons

Add the Social Media Follow module to the row. Style the icon measurement, spacing, and colors to check the header’s navigation style.

Building The Contact Information And CTA Row

The second row has one procedure. It places contact details on the left and a CTA at the correct. Set the row or column to Construction Direction: Row, Justify Content material subject material: Space Between, and Align Items: Stretch. This helps to keep each side aligned across the row.

Setting Space Between and Stretch alignment for the second header row in Divi 5

Building The Contact Details Team of workers

Place the contact details inside of a Module Team of workers. This problems because of Space Between works on direct children. The contact group of workers becomes one products on the left, and the button becomes the item at the correct.

Inside the group of workers, add a Blurb Module for every contact products. A Blurb works smartly because it comprises an icon, determine, and body content material subject material. For the main products, use an envelope icon, set the determine to Email, and add the email handle since the body content material subject material.

Under Design > Image And Icon, set Icon Placement to Left. Under Sizing, set the icon measurement to 20px.

Adding an email Blurb module to a Divi 5 header

Copy the Blurb two instances. Use the copies for the phone amount and industry hours, then transfer the icon, determine, and body content material subject material for every products.

Duplicating and editing contact Blurb modules inside a Divi 5 Module Group

Together with The CTA Button

Add the Button Module outdoor the contact details group of workers. That placement is intentional. The contact group of workers sits on the left, and the button sits at the correct. With Space Between enabled, the CTA lands at the a ways edge of the row.

Adding a CTA Button module to the second row of a Divi 5 header

Making The Construction Responsive

The desktop header has additional content material subject material than a cellular header will have to show. On smaller presentations, keep the logo and hamburger visible, then switch the entire menu proper right into a Canvas.

Hiding Desktop-Perfect Items

Disguise the Link Module group of workers and Social Media Follow module on cellular. Use Advanced > Visibility.

Hiding desktop navigation and social modules on the mobile breakpoint in Divi 5

Add an Icon Module opposite the logo. Set it to a hamburger icon, style it to check the header, and hide it on desktop.

Adding and styling a mobile hamburger icon in Divi 5

Disguise the second nested row on cellular too. The contact and CTA strip takes quite a lot of house in a compact header.

Hiding the second header row on mobile in Divi 5

Adjusting The Mobile Background

The gradient background no longer is sensible on cellular because it used to be as soon as only used to separate two visible rows. At the cellular breakpoint, change the gradient with a flat background color.

The light elements throughout the builder are hidden at the lively breakpoint. That is serving to you confirm what’s visible on cellular.

Setting a flat mobile background color for a Divi 5 header

Setting Up The Mobile Navigation Canvas

Create the cellular menu in a detached Canvas. Use the Canvas dropdown on the most productive of the Visual Builder, then add a brand spanking new Canvas.

Opening the Canvas dropdown in Divi 5

Establish it clearly. Mobile Menu works smartly. Make it world if the identical menu will have to appear across the web page. Set the Z Index to 999 so it appears above the internet web page layout.

Configuring Canvas options for a Divi 5 mobile menu

Positioning The Canvas

Inside the Canvas, middle the content material subject material. Set the column’s Justify Content material subject material and Align Items to Heart. Inside the Canvas phase, transfer to Advanced > Position and set Position to Fastened.

Set Offset Beginning position to Perfect Left and set each and every offsets to 0. This shall we the Canvas duvet the viewport as a substitute of sitting in normal internet web page go with the flow.

See also  WordPress 6.1: “Misha” Now To be had

Setting a Divi 5 Canvas section to fixed position

Transfer to Design > Sizing and set the height to 100vh. Use Flexbox alignment on the Canvas phase or column to middle the menu vertically and horizontally.

Together with The Mobile Menu Content material subject material

Copy the desktop navigation Module Team of workers into the Canvas to save lots of a variety of time. Set the gang’s Construction Direction to Column so the menu items stack vertically.

Set the Column Magnificence to Fullwidth where sought after. Remove any desktop-only visibility settings, then add the CTA button underneath the menu.

Adding a menu loop and CTA button to a Divi 5 mobile Canvas

You’ll moreover add phone, hours, or e-mail details. Perfect include them within the match that they help cellular visitors act faster. Keep the cellular menu centered.

Together with The Close Icon

Add an Icon Module throughout the Canvas and set it to an extensive icon.

Adding a close icon to a Divi 5 mobile menu Canvas

After styling the close icon, transfer to Advanced > Position. Set Position to Fastened, Offset Beginning position to Perfect Right kind, and each and every offsets to 20px. Set the Z Index to 999. This pins the close icon to the corner of the viewport.

Positioning a close icon in the top-right corner of a Divi 5 mobile Canvas

When the Canvas is finished, transfer to the Canvas phase’s Advanced tab. Disable it all the way through all breakpoints beneath Visibility. This helps to keep it hidden on load until an Interaction presentations it.

Wiring Up The Interactions

Choose the hamburger icon and add an Interaction. Set the Purpose Event to Click on on, the Affect Movement to Show Section, and the Objective Module to the cellular menu Canvas phase.

Adding a click interaction to a hamburger icon in Divi 5

Choose the close icon throughout the Canvas and add the other Interaction. Set the Purpose Event to Click on on, the Affect Movement to Disguise Section, and use the identical Canvas phase as the target.

Adding a click interaction to a close icon in a Divi 5 Canvas

Optional Accessibility Cleanup

Give the hamburger and close icons clear labels. That is serving to visitors the usage of assistive technology. If your assemble uses Divi 5’s semantic section possible choices, set the navigation wrapper to nav.

Previewing The Finished Header

That is all it takes to build a sophisticated responsive header in Divi 5.

The outcome’s maintainable. The navigation comes from WordPress, the logo comes from the Site Logo dynamic tag, the cellular menu lives in a Canvas, and the open and close behavior lives in Interactions. The spacing and alignment come from Flexbox, so no hidden reproduction sections are sought after.

Design #2: Single-Row Navigation Header

Now not every web page needs a utility bar. Some internet sites want a clean header that is still out of one of the best ways. This layout works smartly for SaaS products, portfolios, membership internet sites, and lightweight industry internet sites.

The development is discreet. The logo and navigation take a seat down on the left, and supporting actions take a seat down at the correct.

Together with A Two-Column Flexbox Row

The row uses a two-column layout. The wider left column holds the logo and navigation. The narrower correct column holds supporting elements, akin to hunt, cart, social icons, or a CTA.

Using an offset column template for a single-row Divi 5 header

For the row, set the Horizontal Hollow to 2% and the Vertical Hollow to 8px. Set Justify Content material subject material to Get began and Align Items to Stretch. Stretch helps to keep each and every columns the identical most sensible, despite the fact that their contents vary.

Building The Left Column

Set the main column to Construction Direction: Row, Justify Content material subject material: Get began, and Align Items: Heart. Add the logo and navigation the usage of the identical setup from Design #1.

Add an Image Module connected to the Site Logo dynamic tag. Then add a Link Module the usage of Menu Looping.

Building the logo and menu in the first column of a Divi 5 header

Building The Right kind Column

Set the second column to Construction Direction: Row and Align Items: Heart. Use an 8px horizontal and vertical hollow to stick the supporting actions calmly spaced.

Add Icon Modules for search and cart if the web page needs them. Link the cart icon to the cart internet web page for WooCommerce internet sites, and remove it for non-commerce builds. Then add the Social Media Follow module and Button Module facet by way of facet.

Adding icons, social links, and a CTA to the second column of a Divi 5 header
Adapt Your Design To Smaller Breakpoints

Similar to the main header, create a canvas with all the elements you need in your cellular menu: navigation, CTA buttons, and further. Likewise, add an extensive button. Then a hamburger icon next in your web page logo while hiding the whole thing else. And then put up interactions to attach all these pieces together.

The Possibilities Are As regards to Never-ending With Divi 5

The two headers look different, then again the manner is the same. Flexbox handles the layout. Link Modules and Menu Loops handle dynamic navigation. Canvases keep cellular overlays turn into unbiased from the primary header. Interactions handle the open and close behavior.

Each and every device does its section. On account of they’re built into Divi 5, the workflow stays visual and maintainable. You aren’t stitching the header at the side of reproduction sections, CSS fixes, or hidden JavaScript snippets.

Divi 5 is available now. This kind of header workflow is where its layout and interaction improvements shine.

The put up How To Construct A Flexbox Header In Divi 5 seemed first on Chic Issues Weblog.

WordPress Web Design

[ continue ]

WordPress Maintenance Plans | WordPress Hosting

read more

0 Comments

Submit a Comment

DON'T LET YOUR WEBSITE GET DESTROYED BY HACKERS!

Get your FREE copy of our Cyber Security for WordPress® whitepaper.

You'll also get exclusive access to discounts that are only found at the bottom of our WP CyberSec whitepaper.

You have Successfully Subscribed!