1html {
2 background: url(images/bg.jpg) no-repeat center center fixed;
3 -webkit-background-size: cover;
4 -moz-background-size: cover;
5 -o-background-size: cover;
6 background-size: cover;
7}
1body {
2 background-position: center;
3 background-repeat: no-repeat;
4 background-size: cover;
5}
1html {
2 height: 100%;
3}
4body {
5 color: #999;
6 background: url('../images/background/main_bg.jpg') no-repeat center center fixed;
7 font-family: 'Roboto', sans-serif;
8 -webkit-background-size: cover;
9 -moz-background-size: cover;
10 -o-background-size: cover;
11 background-size: cover;
12}
1 /* To make an Image fit the Screen*/
2
3
4METHOD - 1
5
6html {
7 background: url(images/yourImage.jpg) no-repeat center center fixed;
8 -webkit-background-size: cover;
9 -moz-background-size: cover;
10 -o-background-size: cover;
11 background-size: cover;
12}
13
14METHOD - 2
15
16IMP: To make sure that the image covers the whole screen,
17you must apply **height: 100%** to both <html> and <body>:
18
19body, html {
20 height: 100%;
21}
22
1body {
2 background-position: center;
3 background-repeat: no-repeat;
4 background-size: contain;
5}
1html {
2 background: url('img.jpg') no-repeat center center fixed;
3 -webkit-background-size: cover;
4 -moz-background-size: cover;
5 -o-background-size: cover;
6 background-size: cover;
7}