Never Set Mobile & Tablet Font Sizes Again! (CSS Clamp + Elementor)
What is CSS Clamp?
Here’s the magic: it’s called clamp().
Clamp lets you set three values for your font size:
- a minimum size so it never gets too small
- a scaling size that grows and shrinks with the screen
- and a maximum size so it never blows up too big
Example for a heading:
font-size: clamp(40px, 5vw, 70px);
Now instead of managing three device breakpoints, you set it once — and it just works everywhere.
Why CSS Clamp is the Future
Here’s why clamp is considered the future of typography:
- One line, all devices – no more setting separate font sizes for desktop, tablet, and mobile.
- Truly fluid fonts – text scales smoothly as the viewport changes, no jumps.
- Less code, easier maintenance – replace multiple media queries with a single line.
- Future-proof – works on any screen size, today and tomorrow.
- Better readability & UX – headings and body text stay perfectly sized everywhere.
Step 2 – Update Your Fonts to Use Clamp
2a – Set or Update Global Fonts
- Open Elementor → Site Settings → Global Fonts.
- Update or set typography for all text types (H1–H6, Body, Small, etc.).
2b – Add Sample Typography to Test
Copy and paste this into a Text Editor widget to preview all headings and body text:
<h1>H1 - Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum is simply dummy text of the printing and typesetting industry.</h1>
<h2>H2 - Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum is simply dummy text of the printing and typesetting industry.</h2>
<h3>H3 - Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum is simply dummy text of the printing and typesetting industry.</h3>
<h4>H4 - Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum is simply dummy text of the printing and typesetting industry.</h4>
<h5>H5 - Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum is simply dummy text of the printing and typesetting industry.</h5>
<h6>H6 - Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum is simply dummy text of the printing and typesetting industry.</h6>
<p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum is simply dummy text of the printing and typesetting industry.</p>
Step 3 – Collect Existing Font Sizes
Locate your current desktop, tablet, and mobile font sizes in Elementor. Example hierarchy:
H1 – Desktop: 72px | Tablet: 60px | Mobile: 50px
H2 – Desktop: 50px | Tablet: 45px | Mobile: 40px
H3 – Desktop: 40px | Tablet: 30px | Mobile: 26px
H4 – Desktop: 30px | Tablet: 25px | Mobile: 22px
H5 – Desktop: 24px | Tablet: 20px | Mobile: 18px
H6 – Desktop: 20px | Tablet: 18px | Mobile: 16px
Step 4 – Convert to CSS Clamp
Use the following rules to convert font-size values into clamp():
- Use px for the min (mobile) and max (desktop) values.
- Use vw for the scaling value (tablet).
- Add a unitless line-height for each heading to scale proportionally.
- Output each rule in a single line with a CSS comment for clarity.
/* H1 */ h1 { font-size: clamp(50px, 5vw, 72px); line-height: 1.2; }
/* H2 */ h2 { font-size: clamp(40px, 4vw, 50px); line-height: 1.3; }
/* H3 */ h3 { font-size: clamp(26px, 3vw, 40px); line-height: 1.3; }
/* H4 */ h4 { font-size: clamp(22px, 2.5vw, 30px); line-height: 1.4; }
/* H5 */ h5 { font-size: clamp(18px, 2vw, 24px); line-height: 1.4; }
/* H6 */ h6 { font-size: clamp(16px, 1.5vw, 20px); line-height: 1.5; }
Copy and paste directly into Elementor Global Fonts or your Custom CSS for instant responsive typography.
Step 5 – Optional
- If global fonts are not yet set, use the suggested starting values (link in video description).
- Copy-paste snippets from the blog post for a faster workflow.
Step 6 – Test It
- Open Elementor’s Responsive Mode.
- Check Desktop, Tablet, and Mobile views.
- Notice how headings and body text scale smoothly without manual adjustments.
- Resize your browser to see real-time font scaling in action — no breakpoints needed.
Step 7 – Considerations Before Switching
Before updating all your fonts to fluid typography with clamp, keep these points in mind:
- Design consistency – clamp may affect tightly constrained elements like buttons or cards. Test first.
- Theme/plugin conflicts – some styles might override your fonts. Check for overrides.
- Minimum size matters – avoid making text too small on tiny screens.
- Animations – check behavior if you animate font sizes.
Even with these considerations, CSS clamp is a huge time-saver and future-proof approach.