Conditions
Viewport 320–1200px, size 1–2.5rem, root 16px
CSS
clamp(1rem, 0.45rem + 2.72vw, 2.5rem)
Design Tools
From min/max viewport widths and a target size range, compute a clamp() formula for fluid font sizes, spacing, and other lengths that scale with the viewport.
Favorite this tool
No favorite storage mode has been selected.
Quick actions
Copy this tool URL or open the system share sheet on a supported device.
设计配色
现代流式排版 (Fluid Typography/Spacing) 的最佳实践:结合 calc() 和 vw 动态自适应。
流式排版 Fluid Typography Demo
拖动调整容器宽度可预览变化 (需要 Resize Observer 支持,当前为近似模拟)
Conditions
Viewport 320–1200px, size 1–2.5rem, root 16px
CSS
clamp(1rem, 0.45rem + 2.72vw, 2.5rem)
Across the given viewport range, a linear slope maps size from min to max, then clamp(min, preferred, max) caps the ends.
No. Any length you express in rem ranges works—font size, spacing, width, and similar.
Tools
Continue with another translated tool for a nearby task.
CSS Unit Converter
Convert among px, rem, em, pt, vw, vh, and %. Customize root font size, parent font size, and viewport size for responsive work and design-to-code handoff.
Pixel Ruler
Draw a horizontal or vertical pixel ruler on the page. Adjust length and tick spacing, and view window size plus device pixel ratio to check CSS pixel measurements against layouts and mockups.