CSS Gradient Generator
Design stunning linear CSS gradients with interactive color pickers and live code outputs
Design stunning linear CSS gradients with interactive color pickers and live code outputs
function applyPreset() { const preset = document.getElementById('cggPresets').value; if (preset === 'custom') return;
const colors = { sunset: ["#ff7e5f", "#feb47b"], ocean: ["#2b5876", "#4e4376"], forest: ["#11998e", "#38ef7d"] };
document.getElementById('cggColor1').value = colors[preset][0]; document.getElementById('cggColor2').value = colors[preset][1]; updateGradient(); }
function copyGradient() { const el = document.getElementById('cggOutput'); el.select(); navigator.clipboard.writeText(el.value); alert('CSS gradient code copied!'); }
gradients allow you to display smooth transitions between two or more colors without loading heavy image assets, improving page load speeds and responsive styling.