Search code examples
htmlcsswebkitgradient

Can background-color be used if background gradient is not supported?


How could i define a background color for devices that do NOT support gradients ?

body {
    background-image: linear-gradient(to right top, #3498db, #1e82b9, #0b6d97, #025877, #034359);
}

Solution

  • You can simply use background-color as fallback, see snippet:

    body {
        background-image: linear-gradient(to right top, #3498db, #1e82b9, #0b6d97, #025877, #034359);
        background-color: blue;
    }