background-color or background code example

Example 1: what is difference between background and background-color

Premising that those are two distinct properties, in your specific example there's no difference in the result, since background actually is a shorthand for
background-color  
background-image  
background-position  
background-repeat  
background-attachment  
background-clip  
background-origin  
background-size

background: white url(images/image1.jpg) top left repeat;
background: black;

background: url(example.jpg) no-repeat center center #fff;
background-image: url(example.jpg);
background-position: center center;
background-repeat: no-repeat;
background-color: #fff;

Example 2: background color

//javascript type css:
document.body.style.backgroundColor = "blue";
// or inline css:
<div style="background-color: blue;"></div>

Tags:

Css Example