The Fluid CSS Framework for Elementor: The Ultimate A-to-Z Guide

Featured Image Fallback

1. What is this system?

This is a lightweight CSS Utility Framework designed specifically for Elementor.

In standard Elementor workflows, you manually edit the Padding and Margins for every single container (Desktop, Tablet, and Mobile). This framework replaces that manual work with Classes.

Instead of typing numbers into the “Advanced” tab 100 times, you simply type a class name like section-xl or gap-m, and the code handles the spacing, responsiveness, and fluidity automatically.

2. Why should you use it?

If you are building professional websites, manual spacing is the enemy.

  • Speed: You stop clicking the little “responsive mode” icons. One class handles all screen sizes.
  • Consistency: Every “Large” section on your site is mathematically identical. No more “eyeballing” it.
  • Fluidity: We use CSS clamp() functions. This means your padding doesn’t just jump at breakpoints (like Tablet or Mobile); it scales smoothly based on the exact screen width.
  • Maintainability: Client wants more space? You change one variable in the code, and the entire website updates instantly.

3. When should you use it?

  • New Builds: Implement this immediately on a fresh install before you build the Header.
  • Site Revamps: If you are redesigning an old site, strip out the old manual padding and apply this system for a cleaner codebase.
  • Team Projects: If multiple people are working on one site, this prevents “developer drift” where one person uses 100px padding and another uses 80px.

4. Where do you install it?

This code lives in the Global Site Settings of Elementor.

  1. Open any page in Edit with Elementor.
  2. Click the Hamburger Menu (≡) in the top left.
  3. Select Site Settings.
  4. Navigate to Custom CSS.
  5. Paste the code provided below.

Crucial Step: While in Site Settings, go to Layout and set Container Padding to 0. This ensures Elementor’s defaults don’t fight with your new super-powered classes.

5. How do you use it? (The Workflow)

Step 1: Create a Container Drag a new Container widget onto your page.

Step 2: Add the Class Go to the Advanced Tab > CSS Classes. Type the spacing you want.

  • Example: section-l (for large padding).

Step 3: Combine Classes You can stack classes to do complex layouts instantly.

  • Example:section-l section-narrow gap-m
    • Translation: “Give me Large padding (section-l), constrain the width to 1000px (section-narrow), and put medium gaps between my widgets (gap-m).”

6. The Code (Copy & Paste)

Here is the robust, Elementor-proof CSS.

/* =========================================
1. GLOBAL VARIABLES
========================================= */
:root {
/* --- Fluid Side Padding (Left/Right) --- */
--fluid-side-padding-min: 1.25rem; /* Mobile: 20px */
--fluid-side-padding-max: 5rem; /* Desktop: 80px */

/* --- Top/Bottom Section Padding --- */
--section-xxl-padding-min: 9.375rem; /* 150px */
--section-xxl-padding-max: 10rem; /* 160px */

--section-xl-padding-min: 6.875rem; /* 110px */
--section-xl-padding-max: 7.5rem; /* 120px */

--section-l-padding-min: 5.625rem; /* 90px */
--section-l-padding-max: 6.25rem; /* 100px */

--section-m-padding-min: 5rem; /* 80px */
--section-m-padding-max: 5rem; /* 80px */

--section-s-padding-min: 3.75rem; /* 60px */
--section-s-padding-max: 3.75rem; /* 60px */

--section-xs-padding-min: 2.5rem; /* 40px */
--section-xs-padding-max: 2.5rem; /* 40px */

--section-xxs-padding-min: 1.5rem; /* 24px */
--section-xxs-padding-max: 1.5rem; /* 24px */

--section-header-padding-min: 1.25rem; /* 20px */
--section-header-padding-max: 1.25rem; /* 20px */

/* --- Fluid Typography Variables --- */
/* H1: Scales 32px -> 72px */
--fs-h1: clamp(2rem, 5vw + 1rem, 4.5rem);
/* H2: Scales 28px -> 56px */
--fs-h2: clamp(1.75rem, 4vw + 1rem, 3.5rem);
/* H3: Scales 24px -> 40px */
--fs-h3: clamp(1.5rem, 3vw + 1rem, 2.5rem);
/* Body: Scales 16px -> 20px */
--fs-body: clamp(1rem, 0.5vw + 0.8rem, 1.25rem);

/* --- Layout & Structural --- */
--section-hero-height: 100vh;
--section-offset-header: 80px;

/* --- Container Widths --- */
--section-narrow: 62.5rem; /* 1000px */
--section-narrow-xs: 45rem; /* 720px */

/* --- Gap Variables --- */
--gap-xxs: clamp(0.25rem, 1vw, 0.5rem);
--gap-xs: clamp(0.5rem, 1.5vw, 0.75rem);
--gap-s: clamp(0.75rem, 2vw, 1rem);
--gap-m: 1.25rem;
--gap-l: clamp(1.25rem, 3vw, 2.5rem);
--gap-xl: clamp(1.25rem, 5vw, 3.75rem);
--gap-xxl: clamp(1.25rem, 10vw, 7.5rem);
}

/* =========================================
2. SECTION PADDING UTILITIES
========================================= */
.section-xxl {
padding-top: clamp(var(--section-xxl-padding-min), 1.087vw + 9.13rem, var(--section-xxl-padding-max));
padding-bottom: clamp(var(--section-xxl-padding-min), 1.087vw + 9.13rem, var(--section-xxl-padding-max));
padding-left: clamp(var(--fluid-side-padding-min), 6.522vw + -0.217rem, var(--fluid-side-padding-max)) !important;
padding-right: clamp(var(--fluid-side-padding-min), 6.522vw + -0.217rem, var(--fluid-side-padding-max)) !important;
}

.section-xl {
padding-top: clamp(var(--section-xl-padding-min), 1.087vw + 6.63rem, var(--section-xl-padding-max));
padding-bottom: clamp(var(--section-xl-padding-min), 1.087vw + 6.63rem, var(--section-xl-padding-max));
padding-left: clamp(var(--fluid-side-padding-min), 6.522vw + -0.217rem, var(--fluid-side-padding-max)) !important;
padding-right: clamp(var(--fluid-side-padding-min), 6.522vw + -0.217rem, var(--fluid-side-padding-max)) !important;
}

.section-l {
padding-top: clamp(var(--section-l-padding-min), 1.087vw + 5.38rem, var(--section-l-padding-max));
padding-bottom: clamp(var(--section-l-padding-min), 1.087vw + 5.38rem, var(--section-l-padding-max));
padding-left: clamp(var(--fluid-side-padding-min), 6.522vw + -0.217rem, var(--fluid-side-padding-max)) !important;
padding-right: clamp(var(--fluid-side-padding-min), 6.522vw + -0.217rem, var(--fluid-side-padding-max)) !important;
}

.section-m {
padding-top: clamp(var(--section-m-padding-min), 0vw + 5rem, var(--section-m-padding-max));
padding-bottom: clamp(var(--section-m-padding-min), 0vw + 5rem, var(--section-m-padding-max));
padding-left: clamp(var(--fluid-side-padding-min), 6.522vw + -0.217rem, var(--fluid-side-padding-max)) !important;
padding-right: clamp(var(--fluid-side-padding-min), 6.522vw + -0.217rem, var(--fluid-side-padding-max)) !important;
}

.section-s {
padding-top: clamp(var(--section-s-padding-min), 0vw + 3.75rem, var(--section-s-padding-max));
padding-bottom: clamp(var(--section-s-padding-min), 0vw + 3.75rem, var(--section-s-padding-max));
padding-left: clamp(var(--fluid-side-padding-min), 6.522vw + -0.217rem, var(--fluid-side-padding-max)) !important;
padding-right: clamp(var(--fluid-side-padding-min), 6.522vw + -0.217rem, var(--fluid-side-padding-max)) !important;
}

.section-xs {
padding-top: clamp(var(--section-xs-padding-min), 0vw + 2.5rem, var(--section-xs-padding-max));
padding-bottom: clamp(var(--section-xs-padding-min), 0vw + 2.5rem, var(--section-xs-padding-max));
padding-left: clamp(var(--fluid-side-padding-min), 6.522vw + -0.217rem, var(--fluid-side-padding-max)) !important;
padding-right: clamp(var(--fluid-side-padding-min), 6.522vw + -0.217rem, var(--fluid-side-padding-max)) !important;
}

.section-xxs {
padding-top: clamp(var(--section-xxs-padding-min), 0vw + 1.5rem, var(--section-xxs-padding-max));
padding-bottom: clamp(var(--section-xxs-padding-min), 0vw + 1.5rem, var(--section-xxs-padding-max));
padding-left: clamp(var(--fluid-side-padding-min), 6.522vw + -0.217rem, var(--fluid-side-padding-max)) !important;
padding-right: clamp(var(--fluid-side-padding-min), 6.522vw + -0.217rem, var(--fluid-side-padding-max)) !important;
}

.section-header {
padding-top: clamp(var(--section-header-padding-min), 0vw + 1.25rem, var(--section-header-padding-max));
padding-bottom: clamp(var(--section-header-padding-min), 0vw + 1.25rem, var(--section-header-padding-max));
padding-left: clamp(var(--fluid-side-padding-min), 6.522vw + -0.217rem, var(--fluid-side-padding-max)) !important;
padding-right: clamp(var(--fluid-side-padding-min), 6.522vw + -0.217rem, var(--fluid-side-padding-max)) !important;
}

.section-offset {
padding-top: calc(var(--section-offset-header) + var(--section-xxl-padding-min));
}

/* =========================================
3. TYPOGRAPHY & LAYOUT UTILITIES
========================================= */

/* Typography Classes */
.fluid-h1 { font-size: var(--fs-h1) !important; }
.fluid-h2 { font-size: var(--fs-h2) !important; }
.fluid-h3 { font-size: var(--fs-h3) !important; }
.fluid-p { font-size: var(--fs-body) !important; }

/* Structural Helpers */
.section-hero {
min-height: var(--section-hero-height) !important;
display: flex;
flex-direction: column;
}
.section-hero .e-con-inner {
justify-content: center !important;
}

.section-full .e-con-inner {
width: 100% !important;
max-width: 100% !important;
}

.section-narrow .e-con-inner {
max-width: var(--section-narrow) !important;
margin-left: auto;
margin-right: auto;
}

.section-narrow-xs .e-con-inner {
max-width: var(--section-narrow-xs) !important;
margin-left: auto;
margin-right: auto;
}

/* Smart Grid (Auto-wrapping cards) */
.grid-cards {
display: grid !important;
grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)) !important;
}

/* Image Safety */
img {
max-width: 100%;
height: auto;
display: block;
}

/* Helper Utilities */
.text-center { text-align: center !important; }
.text-left { text-align: left !important; }
.text-right { text-align: right !important; }

/* =========================================
4. GAP UTILITIES
========================================= */
.gap-xxs, .gap-xxs > .e-con-inner { gap: var(--gap-xxs); }
.gap-xs, .gap-xs > .e-con-inner { gap: var(--gap-xs); }
.gap-s, .gap-s > .e-con-inner { gap: var(--gap-s); }
.gap-m, .gap-m > .e-con-inner { gap: var(--gap-m); }
.gap-l, .gap-l > .e-con-inner { gap: var(--gap-l); }
.gap-xl, .gap-xl > .e-con-inner { gap: var(--gap-xl); }
.gap-xxl, .gap-xxl > .e-con-inner { gap: var(--gap-xxl); }

7. The A-Z Dictionary

Use these tables as a quick reference when building.

A. Section Padding Classes (Top & Bottom)

Note: All classes also include automatic Left/Right padding.

Class NameDesktop SizeMobile SizeUse Case
section-xxl160px150pxMajor landing page headers.
section-xl120px110pxStandard sections requiring breathing room.
section-l100px90pxThe “Default” for most sections.
section-m80px80pxTighter sections, or text-heavy areas.
section-s60px60pxCall to Action (CTA) strips.
section-xs40px40pxDividers or small info strips.
section-xxs24px24pxVery tight grouping.

B. Fluid Typography (The Text)

Class NameScale LogicUse Case
fluid-h132px → 72pxMain Hero Headlines.
fluid-h228px → 56pxStandard Section Titles.
fluid-h324px → 40pxCard Titles / Sub-headings.
fluid-p16px → 20pxLong-form body text.

C. Layout & Grids (The Structure)

Class NameSize RangeUse Case
gap-xxs4px – 8pxIcons + Text.
gap-m20px (Fixed)Default spacing.
gap-l20px – 40pxCard Grid spacing.

D. Gap Classes (Between Elements)

Note: These control the space between Grid items or Flex items.

Class NameSize RangeUse Case
gap-xxs4px – 8pxGrouping icon + text together.
gap-xs8px – 12pxList items or tight bullet points.
gap-s12px – 16pxStandard button groups.
gap-m20px (Fixed)Default spacing for most layouts.
gap-l20px – 40pxSpacing between cards in a grid.
gap-xl20px – 60pxSpacing between major columns.

F. Helper Classes (Structure)

Class NameFunction
section-heroForces the container to be 100% Viewport Height and centers content vertically.
section-fullForces the inner content to span 100% width (removes the boxed constraint).
section-narrowRestricts content width to 1000px (Great for blog posts).
section-narrow-xsRestricts content width to 720px (Great for long-form reading).
section-offsetAdds extra top padding to compensate for a transparent/overlay header.
Facebook
Twitter
LinkedIn

Other Posts