CSS Clamp()產生器
使用clamp()產生流式、響應式的CSS數值。在視口範圍內於最小值與最大值之間平滑縮放。
font-size: clamp(16px, 13.0909px + 0.9091vw, 24px);
如何使用本工具
- 1
Enter the minimum size in pixels (the value at and below your small viewport).
- 2
Enter the maximum size in pixels (the value at and above your large viewport).
- 3
Set the min and max viewport widths in pixels that define where scaling starts and stops.
- 4
Read the generated clamp() declaration and click Copy to paste it into your stylesheet.
什麼是CSS Clamp()產生器?
CSS clamp(最小值, 首選值, 最大值)函式在讓數值在範圍內流暢縮放的同時,將其約束在邊界之內。它非常適合響應式排版:字級隨視口寬度平滑增長,而不會在斷點處跳變。本工具會根據你的最小/最大字級和視口寬度,計算出正確的首選值公式。
常見使用場景
Building fluid headings that grow from 24px on mobile to 48px on desktop without writing media-query breakpoints.
Setting responsive body copy that stays readable between a 320px phone and a 1200px laptop.
Scaling section padding or gap values fluidly so layouts breathe proportionally across screen sizes.
Replacing a stack of font-size overrides at 480px, 768px, and 1024px with one clamp() declaration.
Generating clamp() values for a design system so spacing and type scale consistently from one formula.
Quickly checking the px and vw math for a fluid value you sketched out in a design tool like Figma.
常見問題
瀏覽器相容性如何?▼
相關工具
顏色轉換工具(HEX/RGB/HSL)
在HEX、RGB和HSL格式之間轉換顏色。可視化選取顏色,或手動輸入數值。
CSS Box Shadow 產生器
以視覺化方式建立 CSS box-shadow 值。即時預覽並複製產生的 CSS。
CSS漸層產生器
建立線性和放射狀CSS漸層。以視覺化方式選擇顏色,並複製產生的CSS。
Cubic Bezier緩動曲線產生器
為CSS建立cubic-bezier緩動曲線。內建標準預設。
配色方案產生器
從任意基準色產生和諧的配色方案。支援互補色、鄰近色、三角色和單色方案。
CSS Border Radius 產生器
以視覺化方式建立複雜的 CSS border-radius 值。可獨立控制每個圓角。