body { background-position: center; background-repeat: no-repeat; background-size: cover; }
body { background-position: center; background-repeat: no-repeat; background-size: contain; }
body, html { height: 100%; } .bg { /* The image used */ background-image: url("img_girl.jpg"); /* Full height */ height: 100%; /* Center and scale the image nicely */ background-position: center; background-repeat: no-repeat; background-size: cover; }
html { background: url(images/bg.jpg) no-repeat center center fixed; -webkit-background-size: cover; -moz-background-size: cover; -o-background-size: cover; background-size: cover; }
#example1 { background: url(mountain.jpg); background-repeat: no-repeat; background-size: auto; } #example2 { background: url(mountain.jpg); background-repeat: no-repeat; background-size: 300px 100px; }
background-size: 100px 50px; /* 100px wide, 50px tall */