A header format is a structural drawback ahead of this can be a visible one. The emblem, navigation, icons, and CTA desire a transparent courting. You wish to have to make a decision the place each and every merchandise sits, how a lot area separates it, and what adjustments on smaller displays.

Flexbox solves that drawback with format laws. In Divi 5, the ones controls are living within the Visible Builder, so you’ll be able to outline the construction visually as an alternative of writing customized CSS. Underneath, we can construct two sensible Flexbox headers and display how Divi 5’s menu, canvas, and interplay equipment paintings in combination.

Contents

Flexbox In Divi 5

Flexbox is a CSS format type for arranging pieces within a container. Pieces can sit down in a row, stack in a column, wrap, develop, shrink, and align.

In Divi 5, Flexbox is a part of the core format gadget. Sections, Rows, Columns, and Module Teams can act as flex boxes. When a component turns into a flex container, its direct youngsters change into flex pieces. That direct-child courting issues all over this educational.

Core Flexbox Controls

Divi 5 will give you visible controls for an important Flexbox settings. You’ll set Structure Course, Justify Content material, Align Pieces, Structure Wrapping, Show Order, and Hole values. Those settings allow you to regulate construction, spacing, and alignment with out customized CSS.

Those controls are responsive. A desktop row can change into a cell column, and pieces can exchange order at other breakpoints. That makes Flexbox superb for headers as a result of a large navigation format can transform a compact cell header with out replica sections.

Why Use Flexbox For Headers

Headers typically want one-dimensional format regulate. Chances are you’ll position a emblem and menu in a row, or stack cell menu pieces in a column. Flexbox handles the ones patterns neatly.

  • Use Show Order to reorder pieces on smaller displays.
  • Use Align Pieces: Stretch when columns want equivalent top.
  • Use Develop To Fill when an merchandise must use to be had area.
  • Use Shrink To Have compatibility when an merchandise must keep compact.
  • Use Hole settings as an alternative of guide padding between modules.
  • Use Structure Wrapping when pieces wish to transfer onto a brand new line.

A very powerful rule is inconspicuous: Flexbox controls the direct youngsters of a container. If a number of modules must behave like one merchandise, position them within a Module Workforce. That makes complicated headers more straightforward to control.

Extra Divi 5 Options To Assist You Construct Higher Headers

Flexbox handles the format, however trendy headers additionally want dynamic navigation, off-canvas menus, and international enhancing. Those Divi 5 options assist with that.

The Hyperlink And Dropdown Modules

A header with out navigation is typically simply branding. Divi 5’s Hyperlink Module will give you a versatile development block for customized menus. You’ll create hyperlinks manually or use Menu Loops to drag pieces from an present WordPress menu.

The usage of Menu Loops

With Menu Loops, one Hyperlink Module can repeat for each and every merchandise in a decided on menu. The menu textual content and URL can come from dynamic content material, which assists in keeping your WordPress menu because the supply of fact. Upload, take away, or reorder menu pieces in WordPress, and the looped navigation can replace with it.

The usage of Dropdown Modules

The Dropdown Module builds on that gadget. Position a Dropdown Module within a dad or mum part, akin to a Hyperlink Module, and Divi connects the dropdown habits to that dad or mum. The dropdown content material space is versatile, so you’ll be able to upload easy hyperlinks, rows, pictures, textual content, buttons, or complete mega menu layouts.

Use Dropdown Modules with care within looped menu pieces. A dropdown positioned within a loop can repeat with each and every looped merchandise. For easy menus, the usual Menu Module continues to be helpful. Use Hyperlink and Dropdown modules when you wish to have extra regulate.

Interactions And Canvases

A header steadily wishes to turn or cover one thing. It will open a cell menu, seek panel, shape, or promo modal. Construction the ones components within the principle header can muddle the format, so Canvases assist stay them separate.

What Canvases Do

Each web page has a Major Canvas for the principle format. Divi 5 additionally means that you can create indifferent Canvases, the place a cell menu, popup, slide-in panel, or staging space can are living out of doors the principle web page construction.

Canvases may also be native or international. An area Canvas belongs to at least one web page, whilst a World Canvas may also be reused around the website. That makes World Canvases helpful for cell menus as a result of you’ll be able to construct the menu as soon as and use it anywhere the worldwide header seems.

What Interactions Do

Interactions make indifferent components interactive. You’ll upload habits within the builder with out writing JavaScript. Make a choice a Cause Tournament, akin to click on, hover, scroll, or viewport access. Then select an Impact Motion, akin to appearing or hiding a component. After all, select the objective part or container that receives the impact.

For headers, that is particularly helpful. A hamburger icon can display a cell menu Canvas, and a shut icon can cover it once more.

Editable Theme Builder Spaces

Headers don’t exist in isolation. They sit down above actual web page content material, and that context issues. Brand dimension, spacing, distinction, and sticky habits are more straightforward to pass judgement on when the web page is visual.

Editable Theme Builder Spaces assist you to edit assigned headers, footers, frame templates, and web page content material in a single front-end builder consultation.

This is helping when development headers as a result of you’ll be able to examine the header towards the hero segment beneath it and modify spacing with out leaving the web page.

World template adjustments observe far and wide that template is assigned, so evaluation each and every breakpoint ahead of publishing.

Sooner than You Construct: Plan The Header Construction

Sooner than opening the Visible Builder, make a decision how the header must paintings on desktop, pill, and cell. Flexbox makes format adjustments more straightforward, however the construct will nonetheless be cleaner if you recognize which components belong in combination and which of them must transfer right into a Canvas.

Map The Header Parts

Get started by means of checklist each and every merchandise the header wishes. Maximum headers come with a emblem, navigation, CTA, social hyperlinks, seek, cart icon, touch main points, or trade hours. Then make a decision which pieces are number one and which can be secondary. Number one pieces must keep visual on desktop. Secondary pieces can transfer into the cell menu or disappear at smaller breakpoints.

  • Stay the emblem visual on each and every breakpoint.
  • Stay the principle CTA visual on desktop when it helps the web page objective.
  • Transfer lengthy navigation menus right into a cell Canvas.
  • Transfer touch main points, hours, and social icons out of the compact cell header.

Workforce Pieces Sooner than Styling Them

Flexbox works at the direct youngsters of a container, because of this construction issues ahead of styling. If an emblem and menu must transfer in combination, position them within a Module Workforce. If 3 touch blurbs must keep in combination at the left aspect of a row, position them within one staff. Then Flexbox can deal with that staff as a unmarried merchandise.

  • Use Module Teams for comparable header components.
  • Use Rows or Columns as the principle flex boxes.
  • Use Hole settings for spacing between direct flex pieces.
  • Keep away from the use of padding as the principle spacing gadget between modules.

Plan The Cell Conduct

The cell header must no longer be a squeezed model of the desktop header. It must be a more practical format with fewer visual pieces. A excellent cell trend is an emblem on one aspect and a hamburger icon at the different. The overall navigation, CTA, and secondary hyperlinks can are living within a World Canvas.

  • Use Show Order when pieces desire a other cell series.
  • Use Visibility settings to cover desktop-only modules on cell.
  • Use a World Canvas when the similar cell menu must seem sitewide.
  • Use Interactions to turn and conceal the cell menu Canvas.

Test The Main points Sooner than Publishing

Small header problems are simple to omit as a result of headers seem on each and every web page. Take a look at the format ahead of publishing the worldwide header.

  • Test desktop, pill, and contact breakpoints.
  • Take a look at widths between the default breakpoints.
  • Ascertain dropdowns and Canvases sit down above web page content material.
  • Set a transparent Z Index for overlays, sticky headers, and dropdowns.
  • Ensure hamburger and shut icons have transparent labels.
  • Test that menu hyperlinks, CTA hyperlinks, cart hyperlinks, and social hyperlinks paintings.

Construction A Flexbox Header In Divi 5

Now, allow us to construct two headers from scratch. We will be able to recreate two layouts from our unfastened 20 Header Design Pack: Design #11 and Design #12.

Divi 5 Flexbox header layout examples

Practice alongside step-by-step. You’ll additionally obtain the assets from this weblog submit to get a sooner get started.

Design #1: 3-Row Stacked Header

Some companies want greater than an emblem and navigation. Clinics, legislation places of work, businesses, and native provider suppliers steadily want touch main points visual instantly. This format makes use of a navigation row and a application row. The application row holds touch data and a CTA.

Atmosphere Up The Header In The Theme Builder

Move to Divi > Theme Builder on your WordPress dashboard. Click on Upload World Header, then Construct World Header. The Visible Builder will open.

Open the segment settings ahead of including modules. Move to Design > Structure and set the Vertical Hole to 0px. This assists in keeping the header rows flush towards each and every different.

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

Subsequent, move to Design > Spacing. Set the highest and backside padding to 0px. The outer segment remains compact, whilst each and every row can nonetheless regulate its personal spacing.

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

Including The Header Rows

Get started with the default single-column row within the segment. This row will grasp the nested rows. Open the row settings and move to Design > Structure.

Set Structure Course to Column, Justify Content material to Get started, Align Pieces to Stretch, and Vertical Hole to 0px. This stacks the nested rows vertically and assists in keeping them edge-to-edge.

Set the row’s best and backside padding to 8px. Subsequent, replica the construction to create two stacked nested rows. The primary row will grasp the brand, navigation, and social icons. The second one row will grasp touch main points and the CTA.

Duplicating a row structure in Divi 5

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

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

Practice the similar alignment good judgment to the column within the first row. This makes the modules more straightforward to align.

Growing The Two-Tone Background

Upload a gradient background to the segment. Set each colour stops to the similar level. This creates a pointy transition as an alternative of a mixed gradient. Use 50% for a good break up, or modify the forestall if one row is taller than the opposite.

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

Construction The Brand, Navigation, And Social Row

The primary nested row has 3 portions: the brand, navigation, and social icons. Flexbox controls how the ones portions sit down in combination.

Including The Brand And Navigation Workforce

Upload a Module Workforce for the brand and navigation cluster. A gaggle turns out to be useful as a result of Flexbox distributes direct youngsters. When comparable modules sit down within a bunch, the crowd behaves as one flex merchandise.

Within the staff, set Structure Course to Row, Horizontal Hole to 2%, Justify Content material to Get started, and Align Pieces to Middle.

Including The Dynamic Brand

Upload an Symbol Module for the brand. As an alternative of importing a static emblem, use the Website online Brand dynamic tag. This connects the header emblem to Divi > Theme Choices > Normal, so long term emblem updates may also be treated from one position.

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

Including The Navigation Hyperlinks

Upload a Hyperlink Module within the similar staff. Taste the typography, spacing, and colours. Use Design Variables the place conceivable so the menu remains in keeping with the remainder of the website.

Applying Design Variables to style a Link Module in Divi 5

Flip at the Loop Part toggle. Set the Question Kind to Menu, make a choice the WordPress menu you wish to have to show, and set the loop order to practice the menu order.

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

Practice the Loop Menu Textual content dynamic tag to the Hyperlink Module label. Then observe the Loop Menu Hyperlink dynamic tag to the Hyperlink URL. The primary controls the visual label. The second one sends each and every merchandise to the right kind web page.

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

A Menu Module can construct a easy navigation bar sooner. Use a looped Hyperlink Module when you wish to have extra regulate.

Including Social Icons

Upload the Social Media Practice module to the row. Taste the icon dimension, spacing, and colours to compare the header’s navigation taste.

Construction The Touch Data And CTA Row

The second one row has one process. It puts touch main points at the left and a CTA at the proper. Set the row or column to Structure Course: Row, Justify Content material: House Between, and Align Pieces: Stretch. This assists in keeping all sides aligned around the row.

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

Construction The Touch Main points Workforce

Position the touch main points within a Module Workforce. This issues as a result of House Between works on direct youngsters. The touch staff turns into one merchandise at the left, and the button turns into the article at the proper.

Within the staff, upload a Blurb Module for each and every touch merchandise. A Blurb works neatly as it contains an icon, identify, and frame content material. For the primary merchandise, use an envelope icon, set the identify to E mail, and upload the e-mail deal with because the frame content material.

Below Design > Symbol And Icon, set Icon Placement to Left. Below Sizing, set the icon dimension to 20px.

Adding an email Blurb module to a Divi 5 header

Reproduction the Blurb two times. Use the copies for the telephone quantity and trade hours, then switch the icon, identify, and frame content material for each and every merchandise.

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

Including The CTA Button

Upload the Button Module out of doors the touch main points staff. That placement is intentional. The touch staff sits at the left, and the button sits at the proper. With House Between enabled, the CTA lands on the some distance fringe of the row.

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

Making The Structure Responsive

The desktop header has extra content material than a cell header must display. On smaller displays, stay the brand and hamburger visual, then transfer the whole menu right into a Canvas.

Hiding Desktop-Best Pieces

Conceal the Hyperlink Module staff and Social Media Practice module on cell. Use Complex > Visibility.

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

Upload an Icon Module reverse the brand. Set it to a hamburger icon, taste it to compare the header, and conceal it on desktop.

Adding and styling a mobile hamburger icon in Divi 5

Conceal the second one nested row on cell too. The touch and CTA strip takes an excessive amount of area in a compact header.

Hiding the second header row on mobile in Divi 5

Adjusting The Cell Background

The gradient background now not is smart on cell as it was once solely used to split two visual rows. On the cell breakpoint, exchange the gradient with a flat background colour.

The pale components within the builder are hidden on the energetic breakpoint. This is helping you ascertain what’s visual on cell.

Setting a flat mobile background color for a Divi 5 header

Atmosphere Up The Cell Navigation Canvas

Create the cell menu in a indifferent Canvas. Use the Canvas dropdown on the best of the Visible Builder, then upload a brand new Canvas.

Opening the Canvas dropdown in Divi 5

Identify it obviously. Cell Menu works neatly. Make it international if the similar menu must seem around the website. Set the Z Index to 999 so apparently above the web page format.

Configuring Canvas options for a Divi 5 mobile menu

Positioning The Canvas

Within the Canvas, heart the content material. Set the column’s Justify Content material and Align Pieces to Middle. Within the Canvas segment, move to Complex > Place and set Place to Mounted.

Set Offset Starting place to Best Left and set each offsets to 0. This we could the Canvas quilt the viewport as an alternative of sitting in customary web page float.

Setting a Divi 5 Canvas section to fixed position

Move to Design > Sizing and set the peak to 100vh. Use Flexbox alignment at the Canvas segment or column to heart the menu vertically and horizontally.

Including The Cell Menu Content material

Reproduction the desktop navigation Module Workforce into the Canvas to save lots of time. Set the crowd’s Structure Course to Column so the menu pieces stack vertically.

Set the Column Elegance to Fullwidth the place wanted. Take away any desktop-only visibility settings, then upload the CTA button beneath the menu.

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

You’ll additionally upload telephone, hours, or e mail main points. Best come with them in the event that they assist cell guests act sooner. Stay the cell menu targeted.

Including The Shut Icon

Upload an Icon Module within the Canvas and set it to an in depth icon.

Adding a close icon to a Divi 5 mobile menu Canvas

After styling the shut icon, move to Complex > Place. Set Place to Mounted, Offset Starting place to Best Proper, and each offsets to 20px. Set the Z Index to 999. This pins the shut icon to the nook of the viewport.

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

When the Canvas is done, move to the Canvas segment’s Complex tab. Disable it throughout all breakpoints underneath Visibility. This assists in keeping it hidden on load till an Interplay displays it.

Wiring Up The Interactions

Make a choice the hamburger icon and upload an Interplay. Set the Cause Tournament to Click on, the Impact Motion to Display Part, and the Goal Module to the cell menu Canvas segment.

Adding a click interaction to a hamburger icon in Divi 5

Make a choice the shut icon within the Canvas and upload the opposite Interplay. Set the Cause Tournament to Click on, the Impact Motion to Conceal Part, and use the similar Canvas segment as the objective.

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

Non-compulsory Accessibility Cleanup

Give the hamburger and shut icons transparent labels. This is helping guests the use of assistive era. In case your construct makes use of Divi 5’s semantic part choices, set the navigation wrapper to nav.

Previewing The Completed Header

This is all it takes to construct a complicated responsive header in Divi 5.

The result’s maintainable. The navigation comes from WordPress, the brand comes from the Website online Brand dynamic tag, the cell menu lives in a Canvas, and the open and shut habits lives in Interactions. The spacing and alignment come from Flexbox, so no hidden replica sections are wanted.

Design #2: Unmarried-Row Navigation Header

No longer each and every website wishes a application bar. Some websites desire a blank header that remains out of the best way. This format works neatly for SaaS merchandise, portfolios, club websites, and light-weight trade websites.

The construction is inconspicuous. The emblem and navigation sit down at the left, and supporting movements sit down at the proper.

Including A Two-Column Flexbox Row

The row makes use of a two-column format. The broader left column holds the brand and navigation. The narrower proper column holds supporting components, akin to seek, cart, social icons, or a CTA.

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

For the row, set the Horizontal Hole to 2% and the Vertical Hole to 8px. Set Justify Content material to Get started and Align Pieces to Stretch. Stretch assists in keeping each columns the similar top, even if their contents range.

Construction The Left Column

Set the primary column to Structure Course: Row, Justify Content material: Get started, and Align Pieces: Middle. Upload the brand and navigation the use of the similar setup from Design #1.

Upload an Symbol Module attached to the Website online Brand dynamic tag. Then upload a Hyperlink Module the use of Menu Looping.

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

Construction The Proper Column

Set the second one column to Structure Course: Row and Align Pieces: Middle. Use an 8px horizontal and vertical hole to stay the supporting movements lightly spaced.

Upload Icon Modules for seek and cart if the website wishes them. Hyperlink the cart icon to the cart web page for WooCommerce websites, and take away it for non-commerce builds. Then upload the Social Media Practice module and Button Module aspect by means of aspect.

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

Very similar to the primary header, create a canvas with all of the components you wish to have on your cell menu: navigation, CTA buttons, and extra. Likewise, upload an in depth button. Then a hamburger icon subsequent for your website emblem whilst hiding the whole lot else. After which submit interactions to glue most of these items in combination.

The Chances Are Just about Unending With Divi 5

The 2 headers glance other, however the means is similar. Flexbox handles the format. Hyperlink Modules and Menu Loops deal with dynamic navigation. Canvases stay cell overlays become independent from the principle header. Interactions deal with the open and shut habits.

Every instrument does its phase. As a result of they’re constructed into Divi 5, the workflow remains visible and maintainable. You aren’t sewing the header in conjunction with replica sections, CSS fixes, or hidden JavaScript snippets.

Divi 5 is to be had now. This type of header workflow is the place its format and interplay enhancements shine.

The submit How To Construct A Flexbox Header In Divi 5 gave the impression first on Chic Issues Weblog.

WordPress Web Design

[ continue ]