background color change css code example

Example 1: css background color

body {
  background-color: green;
}

Example 2: background color using css

/* To apply color to background you have to use 'background-color' property and value of property is color name. */
html,body {
  background-color: blue;
}

Example 3: how to change background color in css

body{
  background: lightblue;
}

Example 4: html color changing background

@keyframes bgcolor {
    0% {
        background-color: #45a3e5
    }

    30% {
        background-color: #66bf39
    }

    60% {
        background-color: #eb670f
    }

    90% {
        background-color: #f35
    }

    100% {
        background-color: #864cbf
    }
}

body {
    -webkit-animation: bgcolor 20s infinite;
    animation: bgcolor 10s infinite;
    -webkit-animation-direction: alternate;
    animation-direction: alternate;
}

Tags:

Html Example