#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 is Responsible for Setting a Background picutre in a given
Contaiener in which you apply that special Background
/* This will make width as static and height as auto */
/* These three are quite same */
background-size: 100vw auto;
background-size: 100%;
background-size: cover;
/* for getting full width and height every time */
background-size: 100vw 100vh;
/* Keyword values */
background-size: cover;
background-size: contain;
/* One-value syntax */
/* Only width of image (height is 'auto') */
background-size: 70%;
background-size: 4rem;
background-size: 50px;
background-size: auto;
/* Two-value syntax */
/* first: width, second: height */
background-size: 70% auto;
background-size: 4rem 25%;
background-size: auto 10px;
background-size: auto auto;
/* Multiple background images */
background-size: auto, auto; /* Not the same as 'auto auto' */
background-size: 70%, 20%, 25%;
background-size: 6rem, auto, contain;
html {
background: url(greatimage.jpg);
background-size: 300px 100px;
}
html {
background: url(greatimage.jpg);
background-size: 300px 100px;
}
html {
background: url(greatimage.jpg);
background-size: 300px 100px;
}
html {
background: url(greatimage.jpg);
background-size: 300px 100px;
}
html {
background: url(greatimage.jpg);
background-size: 300px 100px;
}
html {
background: url(greatimage.jpg);
background-size: 300px 100px;
}