How to resize an background image to fit in the browser window?

CSS
html { 
  background: url(images/bg.jpg) no-repeat center center fixed; 
  -webkit-background-size: cover;  
}
Source

Also in CSS: