F

CSS 渐变生成器CSS Gradient Generator

可视化生成CSS渐变代码Visually generate CSS gradient code.

添加第三个颜色
background: linear-gradient(135deg, #667eea, #764ba2);

预设渐变

关于 CSS 渐变生成器About CSS Gradient Generator

CSS 渐变能替代大量背景图片,既减小请求体积又保持任意分辨率下清晰。本工具可视化调整线性/径向渐变的颜色、角度与色标位置,实时生成可直接使用的 CSS 代码。CSS gradients replace countless background images — smaller payloads and crisp at any resolution. This tool visually adjusts linear/radial gradient colours, angle and stop positions, generating ready-to-use CSS code in real time.

使用方法How to Use

  1. 选择渐变类型:线性或径向。Choose the gradient type: linear or radial.
  2. 添加色标并调整每个色标的颜色与位置。Add colour stops and adjust each stop’s colour and position.
  3. 线性渐变可拖动或输入角度。For linear gradients, drag or type the angle.
  4. 复制生成的 background: linear-gradient(...) 代码到样式表。Copy the generated background: linear-gradient(...) code into your stylesheet.

常见问题FAQ

如何做出硬边(色块拼接)渐变?How do I make hard-edge gradients?

让相邻两个色标处于相同位置,即可得到清晰边界,常用于条纹、色块背景与进度条效果。Place two adjacent stops at the same position to get a sharp boundary — handy for stripes, colour blocks and progress bars.

支持三个以上颜色吗?Can I use more than three colours?

支持。添加多个色标后默认均匀分布,也可单独调整每个色标位置,做出彩虹、日落等复杂效果。Yes. Multiple stops distribute evenly by default and each position is adjustable, enabling rainbows, sunsets and more.

渐变需要加浏览器前缀吗?Do gradients need vendor prefixes?

现代浏览器均支持标准语法,无需 -webkit- 前缀;只有需要兼容极老浏览器时才考虑回退方案。Modern browsers fully support the standard syntax without -webkit- prefixes; only very old browsers need fallbacks.

相关阅读Related Reading

相关工具Related Tools