In diesem kurzen Tutorial lernst du, wie du ein einfaches, sauberes Fluid-Container-System für Elementor mit reinem CSS und der clamp()
-Funktion erstellst.
Dieser Ansatz bietet dir flexible, responsive Abstände, ohne dass zusätzliche Plugins oder überladene Frameworks erforderlich sind.
Oh, und es gibt unten eine kostenlose Vorlage, die du als Framework nutzen kannst, um Sektionen in Elementor hinzuzufügen.
Dieses Framework garantiert dir eine schnellere Seitenerstellung und sorgt für ein saubereres Design mit konsistenten Abständen in deinen Layouts.
Vordefinierte Klassen
Dies sind die Klassen, die du im äußeren Container deiner Sektion verwenden wirst. Um mehr über deren Nutzung zu erfahren, schau dir unbedingt das Video am Ende dieses Artikels an.
- section-xxl – Für extra, extra große Sektionen und kleine Banner
- section-xl – Extra große Sektionen mit viel Platz
- section-l – Große Sektionen (verwende ich für die meisten Sektionen)
- section-m – Mittlere Sektionen
- section-s – Kleine Sektionen
- section-xs – Extra kleine Sektionen
- section-xxs – Extra, extra kleine Sektionen
- section-hero – Steuert die Höhe (VH) für Hero-Banner, standardmäßig auf
100vh
gesetzt - section-full – Erstellt eine Vollbreiten-Sektion und entfernt die seitlichen Abstände. Füge eine weitere Sektionsklasse hinzu, um oben und unten Padding hinzuzufügen.
- section-narrow – Erstellt eine schmale Sektion mit einer Breite von 1000px für den Inhalt
- section-narrow-xs – Erstellt eine extra schmale Sektion mit einer Breite von 720px für den Inhalt
- section-offset – Verwendet für Banner mit überlagerten Headern. Dadurch wird das obere Padding versetzt.
CSS-Vorlage
Füge das folgende CSS an der Stelle ein, an der du dein CSS und deinen benutzerdefinierten Code verwaltest.
Meine Empfehlung: Verwende ein Code-Management-Plugin wie FluentSnippets oder WP Codebox.
Um das CSS anzupassen, ist es am besten, das Video-Tutorial unten anzusehen.
/* variables (edit here)*/
:root {
/* Global Padding Variables - Editable */
/* Left and Right Padding All /Sections/Containers*/
--fluid-side-padding-min: 1.25rem; /* 20px */
--fluid-side-padding-max: 5rem; /* 80px */
/* Top and Bottom Padding All Containers*/
--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 */
/* Hero Sections Height Variable */
--section-hero-height: 100vh; /* 100% the screen height */
/* Offset Padding for Overlay Headers */
--section-offset-header: 80px; /* Adjust to the overlay header's negative margin */
/* Width For Narrow Sections*/
--section-narrow: 62.5rem; /* 1000px */
--section-narrow-xs: 45rem; /* 720px */
}
/* CSS Template (do not edit below) */
/* Section/Container Padding - Fluid Variants */
.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;
}
/* Hero Container/Sections Height */
.section-hero {
min-height: var(--section-hero-height)!important;
}
.section-hero .e-con-inner {
justify-content: center!important;
}
/* Full Width Sections - No Side Padding */
.section-full div {
max-width: 100%!important;
}
/* Narrow Sections */
.section-narrow .e-con-inner {
max-width: var(--section-narrow)!important;
}
.section-narrow-xs .e-con-inner {
max-width: var(--section-narrow-xs)!important;
}
/* Offset Padding for Overlay Headers */
.section-offset {
padding-top: calc(var(--section-offset-header) + var(--section-xxl-padding-min));
}
Falls du neu im Umgang mit CSS bist und es lieber vermeiden möchtest, ist das völlig in Ordnung.
Der Code ist zu 100 % einsatzbereit und muss nicht verändert oder angepasst werden.
Quelle Lytbox Akademie